
# Charlemagne misc Zunist events

namespace = CM


####################################################
# Zunist torture events
# By Henrik "Groogy" Hansson
####################################################
character_event = {
	id = CM.15000
	
	desc = "EVTDESCCM15000"
	picture = GFX_evt_emissary
	
	is_triggered_only = yes
	
	immediate = {
		add_character_modifier = {
			name = zun_judgement
			duration = -1
		}
		
		character_event = { id = CM.15001 days = 30 }
	}
	
	option = {
		name = "OK"
	}
}

character_event = {
	id = CM.15001
	
	hide_window = yes
	#desc = "EVTDESCCM15001"
	#picture = GFX_evt_emissary
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				NOT = { trait = incapable }
				NOT = { has_character_flag = passing_zen_judgement }
				NOT = { trait = zealous }
				NOT = { trait = cynical }
				NOT = { religion = zun_pagan }
				NOT = { religion = zun_pagan_reformed }
				NOT = { trait = lunatic }
			}
			
			set_character_flag = passing_zen_judgement
			random_list = {
				60 = { character_event = { id = CM.15003 } } # Character lives
				10 = { character_event = { id = CM.15004 } } # Character dies
				5 = { character_event = { id = CM.15005 } } # Character goes insane
				5 = { character_event = { id = CM.15006 } } # Character goes zealous
				5 = { character_event = { id = CM.15007 } } # Character goes zunist
				10 = { character_event = { id = CM.15002 } }  # Character is freed
			}
		}
		
		if = {
			limit = {
				NOT = { trait = incapable }
				NOT = { has_character_flag = passing_zen_judgement }
				NOT = { trait = zealous }
				NOT = { trait = cynical }
				NOT = { religion = zun_pagan }
				NOT = { religion = zun_pagan_reformed }
				trait = lunatic
			}
			
			set_character_flag = passing_zen_judgement
			random_list = {
				60 = { character_event = { id = CM.15003 } } # Character lives
				5 = { character_event = { id = CM.15004 } } # Character dies
				5 = { character_event = { id = CM.15006 } } # Character goes zealous
				5 = { character_event = { id = CM.15007 } } # Character goes zunist
				20 = { character_event = { id = CM.15002 } }  # Character is freed
			}
		}
		
		if = {
			limit = {
				NOT = { trait = incapable }
				NOT = { has_character_flag = passing_zen_judgement }
				NOT = { trait = lunatic }
			}
			
			set_character_flag = passing_zen_judgement
			random_list = {
				60 = { character_event = { id = CM.15003 } } # Character lives
				5 = { character_event = { id = CM.15004 } } # Character dies
				5 = { character_event = { id = CM.15005 } } # Character goes insane
				20 = { character_event = { id = CM.15002 } }  # Character is freed
			}
		}
		
		if = {
			limit = {
				NOT = { trait = incapable }
				NOT = { has_character_flag = passing_zen_judgement }
			}
			
			set_character_flag = passing_zen_judgement
			random_list = {
				60 = { character_event = { id = CM.15003 } } # Character lives
				5 = { character_event = { id = CM.15004 } } # Character dies
				20 = { character_event = { id = CM.15002 } }  # Character is freed
			}
		}
		
		if = {
			limit = {
				trait = incapable
				NOT = { has_character_flag = passing_zen_judgement }
			}
			
			set_character_flag = passing_zen_judgement
			random_list = {
				60 = { character_event = { id = CM.15003 } } # Character lives
				40 = { character_event = { id = CM.15004 } } # Character dies
				10 = { character_event = { id = CM.15002 } }  # Character is freed
			}
		}
	}
}

character_event = {	# End torture
	id = CM.15002
	
	desc = "EVTDESCCM15002"
	picture = GFX_evt_emissary
	
	is_triggered_only = yes
	
	trigger = {
		has_character_modifier = zun_judgement
		prisoner = yes
	}
	
	option = {
		name = "EVTOPTACM15002"
		remove_character_modifier = zun_judgement
		clr_character_flag = passing_zen_judgement
		prisoner = no
		liege = {
			remove_opinion = { who = ROOT modifier = opinion_dishonorable }
			remove_opinion = { who = ROOT modifier = opinion_traitor }
			remove_opinion = { who = ROOT modifier = opinion_rebel_traitor }
			remove_opinion = { who = ROOT modifier = opinion_regicide_traitor }
			remove_opinion = { who = ROOT modifier = opinion_targeted_by_adventurer }
			remove_opinion = { who = ROOT modifier = slut_seductress }
			remove_opinion = { who = ROOT modifier = attempted_murder_of_spouse }
			remove_opinion = { who = ROOT modifier = attempted_murder_of_child }
			remove_opinion = { who = ROOT modifier = attempted_murder_of_parent }
			remove_opinion = { who = ROOT modifier = attempted_murder_of_sibling }
			remove_opinion = { who = ROOT modifier = attempted_murder_of_vassal }
			remove_opinion = { who = ROOT modifier = attempted_murder }
			remove_opinion = { who = ROOT modifier = opinion_spouse_slayer }
			remove_opinion = { who = ROOT modifier = opinion_murder_attempt }
			remove_opinion = { who = ROOT modifier = opinion_killed_close_kin }
			remove_opinion = { who = ROOT modifier = opinion_fatwa_target }
			remove_opinion = { who = ROOT modifier = opinion_refused_order }
			remove_opinion = { who = ROOT modifier = opinion_witch }
			remove_opinion = { who = ROOT modifier = opinion_takfir }
			remove_opinion = { who = ROOT modifier = opinion_unfaithful_wife }
			remove_opinion = { who = ROOT modifier = opinion_unfaithful_husband }
			remove_opinion = { who = ROOT modifier = opinion_cuckolded }
			remove_opinion = { who = ROOT modifier = opinion_charge_heresiarch }
			remove_opinion = { who = ROOT modifier = opinion_charge_infidel }
			remove_opinion = { who = ROOT modifier = opinion_charge_deviant }
			remove_opinion = { who = ROOT modifier = opinion_charge_illegitimate }
			remove_opinion = { who = ROOT modifier = opinion_charge_traitor }
			remove_opinion = { who = ROOT modifier = opinion_charge_slanderer }
			remove_opinion = { who = ROOT modifier = abuse_of_office }
			remove_opinion = { who = ROOT modifier = opinion_charge_traitor }
			remove_opinion = { who = ROOT modifier = attempted_kidnapping }
			remove_opinion = { who = ROOT modifier = attempted_kidnapping_of_kin }
			remove_opinion = { who = ROOT modifier = attempted_kidnapping_of_vassal }
			remove_opinion = { who = ROOT modifier = attempted_murder_of_close_kin }
			remove_opinion = { who = ROOT modifier = devious_plotter }
			remove_opinion = { who = ROOT modifier = killed_vassal }
			remove_opinion = { who = ROOT modifier = mad_heretic }
			remove_opinion = { who = ROOT modifier = opinion_civil_war_loser }
			remove_opinion = { who = ROOT modifier = opinion_independent }
			remove_opinion = { who = ROOT modifier = opinion_kidnapped_kin }
			remove_opinion = { who = ROOT modifier = opinion_eloped_target }		
		}
	}
}

character_event = {	# Character lives
	id = CM.15003
	
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		clr_character_flag = passing_zen_judgement
		character_event = { id = CM.15001 days = 30 }
	}
}

character_event = {	# Character dies
	id = CM.15004
	
	desc = "EVTDESCCM15004"
	picture = GFX_evt_emissary
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTACM15004"
		remove_character_modifier = zun_judgement
		clr_character_flag = passing_zen_judgement
		host = {
			ROOT = {
				death = { 
					killer = PREV
					death_reason = death_sacrificed
				}
			}
		}

	}
}

character_event = {	# Character goes insane
	id = CM.15005
	
	desc = "EVTDESCCM15005"
	picture = GFX_evt_emissary
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTACM15005"
		clr_character_flag = passing_zen_judgement
		add_trait = lunatic
		character_event = { id = CM.15001 days = 30 }
	}
}

character_event = {	# Character goes zealous
	id = CM.15006
	
	desc = "EVTDESCCM15006"
	picture = GFX_evt_emissary
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTACM15006"
		clr_character_flag = passing_zen_judgement
		add_trait = zealous
		character_event = { id = CM.15001 days = 30 }
	}
}

character_event = {	# Character goes zunist
	id = CM.15007
	
	desc = "EVTDESCCM15007"
	picture = GFX_evt_emissary
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTACM15007"
		clr_character_flag = passing_zen_judgement
		religion = zun_pagan
		character_event = { id = CM.15001 days = 30 }
	}
}

