namespace = WCRAC
# Long-lived characters dies of old age/illness
character_event = {
	id = WCRAC.1
	desc = "EVTDESC_WCRAC_1"
	picture = "GFX_evt_recovery"

	min_age = 100
	
	hide_window = yes
	
	trigger = {
		age = 100
		is_completely_immortal_trigger = no
		# Add here new races whose lifespan is less than 10000 years
		OR = {
			# Races
			trait = creature_dwarf
			trait = creature_gnome
			is_high_elf_trigger = yes
			trait = creature_naga
			trait = creature_vrykul
			trait = creature_giant
			trait = creature_night_elf
			trait = creature_highborne
			trait = creature_mogu
			trait = creature_mantid
			# Classes
			# has_5_6_magic_class_or_higher_trigger = yes
			# has_7_8_magic_class_or_higher_trigger = yes
			has_9_10_magic_class_trigger = yes
		}
	}

	mean_time_to_happen = {
		years = 100
		# Race modifiers
		# Note: don't forget to change average_lifespan, text_effect_average_lifespan_immortality, is_old_immortal_physical_age_trigger everywhere when you touch these modifiers
		modifier = {
			factor = 1.5
			trait = creature_dwarf
		}
		modifier = {
			factor = 2
			trait = creature_gnome
		}
		modifier = {
			factor = 9
			is_high_elf_trigger = yes
		}
		modifier = {
			factor = 14
			trait = creature_naga
		}
		modifier = {
			factor = 1.5
			trait = creature_vrykul
		}
		modifier = {
			factor = 7
			trait = creature_giant
		}
		modifier = {
			factor = 14
			trait = creature_night_elf
		}
		modifier = {
			factor = 14
			trait = creature_highborne
		}
		modifier = {
			factor = 1.5
			trait = creature_mogu
		}
		modifier = {
			factor = 1.5
			trait = creature_mantid
		}
		# Health modifiers
		modifier = {
			factor = 0.84
			NOT = { health = 2 }
		}
		modifier = {
			factor = 0.84
			NOT = { health = 3 }
		}
		modifier = {
			factor = 0.84
			NOT = { health = 4 }
		}
		modifier = {
			factor = 0.84
			NOT = { health = 5 }
		}
		modifier = {
			factor = 1.1
			health = 6
		}
		modifier = {
			factor = 1.1
			health = 7
		}
		modifier = {
			factor = 1.1
			health = 8
		}
		modifier = {
			factor = 1.1
			health = 9
		}
		modifier = {
			factor = 0.1
			is_incapable = yes
		}
		modifier = {
			factor = 0.1
			trait = infirm
		}
		modifier = {
			factor = 0.1
			is_ill = yes
		}
		modifier = {
			factor = 0.1
			has_injury_trigger = yes
		}
	}
	
	immediate = {
		if = {
			limit = {
				OR = {
					is_ill = yes
					has_injury_trigger = yes
				}
			}
			death = { death_reason = death_trait }
		}
		else = {
			death_natural_effect = yes
		}
	}
}

# on_employer_change
character_event = {
	id = WCRAC.5
	
	is_triggered_only = yes
	hide_window = yes
	
	trigger = {
		is_alive = yes
		is_dying = no
		
		FROM = { character = no }
		NOT = { has_character_flag = race_delay_flag }
		
		has_race_trait_trigger = no
	}
	
	immediate = {
		# log = "WCRAC.5 fired for [Root.GetBestName]"
		
		character_event = { id = WCRAC.10 }
	}
}
# Adds race traits
# Fired by decision, on_birth, on_new_holder, on_new_holder_inheritance, on_new_holder_usurpation
character_event = {
	id = WCRAC.10

	hide_window = yes
	is_triggered_only = yes

	trigger = {
		is_alive = yes
		is_dying = no
		
		# potential_race_trigger = yes
		has_race_trait_trigger = no
	}

	immediate = {
		# log = "WCRAC.10 fired for [Root.GetBestName]"
		true_father_even_if_dead = { save_event_target_as = target_father }
		mother_even_if_dead = { save_event_target_as = target_mother }
		
		set_character_flag = no_show_what_become_flag		# Cancel show_close_people_what_this_become_effect if character spawned as undead, demon, void being
		set_character_flag = no_religion_change_flag		# Cancel event religion change

		# Children born in prison take warden's religion and culture
		# It's hardcoded vanilla mechanic, but it can't be like that in Warcraft setting, so here we go
		# Picks mother's religion and culture if child is born in prison
		if = {
			limit = {
				NOT = { age = 1 }
				prisoner = yes
				event_target:target_mother = { always = yes }
			}
			religion = event_target:target_mother
			culture = event_target:target_mother
		}

		# Picks graphical culture
		if = {
			limit = {
				NOT = { age = 1 }
				event_target:target_father = { always = yes }
				event_target:target_mother = { always = yes }
			}
			# If father is infertile or dead, always picks mother's graphical culture
			if = {
				limit = {
					event_target:target_father = {
						OR = {
							is_alive = no
							can_has_children_trigger = no
						}
					}
				}
				log = "[Root.GetBestName] picks mother's race because of father is infertile or dead"

				event_target:target_mother = { ROOT = { set_prev_gfx_effect = yes } }
			}
			# Halfbreed child was born, picks graphical culture
			else_if = {
				limit = {
					NOT = {
						has_game_rule = {
							name = halfbreed_race
							value = random
						}
					}

					event_target:target_father = { event_target:target_mother = { has_prev_race_trigger = no } }
				}
				if = {
					limit = {
						has_game_rule = {
							name = halfbreed_race
							value = father
						}
					}
					log = "[Root.GetBestName] picks father's race because of Father rule"
					
					event_target:target_father = { ROOT = { set_prev_gfx_effect = yes } }
				}
				else_if = {
					limit = {
						has_game_rule = {
							name = halfbreed_race
							value = mother
						}
					}
					log = "[Root.GetBestName] picks mother's race because of Mother rule"
					
					event_target:target_mother = { ROOT = { set_prev_gfx_effect = yes } }
				}
				# If child has mother's dynasty, picks mother's graphical culture
				else_if = {
					limit = { dynasty = event_target:target_father }
					log = "[Root.GetBestName] picks father's race because of Dynasty rule"
					
					event_target:target_father = { ROOT = { set_prev_gfx_effect = yes } }
				}
				else = {
					log = "[Root.GetBestName] picks mother's race because of Dynasty rule"
					
					event_target:target_mother = { ROOT = { set_prev_gfx_effect = yes } }
				}
			}
		}
		
		# Add new races always at the end
		if = {
			limit = { potential_race_human_trigger = yes }
			add_trait = creature_human
		}
		else_if = {
			limit = { potential_race_orc_trigger = yes }
			add_trait = creature_orc
		}
		else_if = {
			limit = { potential_race_ogre_trigger = yes }
			add_trait = creature_ogre
			if = {
				limit =  { graphical_culture = twoheadedogregfx }
				add_trait = twoheaded
			}
			else = {
				random = {
					chance = 5
					add_trait = twoheaded
					set_graphical_culture = twoheadedogre
				}
			}
		}
		else_if = {
			limit = { potential_race_troll_trigger = yes }
			add_trait = creature_troll
		}
		else_if = {
			limit = { potential_race_murloc_trigger = yes }
			add_trait = creature_murloc
		}
		else_if = {
			limit = { potential_race_gnoll_trigger = yes }
			add_trait = creature_gnoll
		}
		else_if = {
			limit = { potential_race_kobold_trigger = yes }
			add_trait = creature_kobold
		}
		else_if = {
			limit = { potential_race_dwarf_trigger = yes }
			add_trait = creature_dwarf
		}
		else_if = {
			limit = { potential_race_gnome_trigger = yes }
			add_trait = creature_gnome
		}
		else_if = {
			limit = { potential_race_high_elf_trigger = yes }
			add_trait = creature_high_elf
		}
		else_if = {
			limit = { potential_race_blood_elf_trigger = yes }
			add_trait = creature_blood_elf
		}
		else_if = {
			limit = { potential_race_naga_trigger = yes }
			add_trait = creature_naga
			add_trait_void_creature_effect = yes
		}
		else_if = {
			limit = {
				OR = {
					potential_race_red_dragon_trigger = yes
					potential_race_blue_dragon_trigger = yes
					potential_race_green_dragon_trigger = yes
					potential_race_black_dragon_trigger = yes
					potential_race_bronze_dragon_trigger = yes
					potential_race_infinite_dragon_trigger = yes
				}
			}
			character_event = { id = WCDRA.150 }
		}
		else_if = {
			limit = { potential_race_goblin_trigger = yes }
			add_trait = creature_goblin
		}
		else_if = {
			limit = { potential_race_pygmy_trigger = yes }
			add_trait = creature_pygmy
		}
		else_if = {
			limit = { potential_race_hozen_trigger = yes }
			add_trait = creature_hozen
		}
		else_if = {
			limit = { potential_race_draenei_trigger = yes }
			add_trait = creature_draenei
		}
		else_if = {
			limit = { potential_race_arakkoa_corrupted_trigger = yes }
			add_trait = creature_arakkoa_corrupted
		}
		# else_if = {
			# limit = { potential_race_ghoul_trigger = yes }
			# add_trait = creature_ghoul
			# add_trait_undead_effect = yes
		# }
		else_if = {
			limit = { potential_race_wraith_trigger = yes }
			add_trait = creature_wraith
			add_trait_undead_effect = yes
		}
		else_if = {
			limit = { potential_race_banshee_trigger = yes }
			add_trait = creature_banshee
			add_trait_undead_effect = yes
		}
		else_if = {
			limit = { potential_race_plague_eruptor_trigger = yes }
			add_trait = creature_plague_eruptor
			add_trait_undead_effect = yes
		}
		else_if = {
			limit = { potential_race_abomination_trigger = yes }
			add_trait = creature_abomination
			add_trait_undead_effect = yes
		}
		else_if = {
			limit = { potential_race_lich_trigger = yes }
			add_trait = creature_lich
			add_trait_undead_effect = yes
		}
		else_if = {
			limit = { potential_race_wickerman_trigger = yes }
			add_trait = creature_wickerman
			add_trait_undead_effect = yes
		}
		else_if = {
			limit = { potential_race_wicker_behemoth_trigger = yes }
			add_trait = creature_wicker_behemoth
			add_trait_undead_effect = yes
		}
		else_if = {
			limit = { potential_race_wicker_golem_trigger = yes }
			add_trait = creature_wicker_golem
			add_trait_undead_effect = yes
		}
		else_if = {
			limit = { potential_race_annihilan_trigger = yes }
			add_trait = creature_annihilan
			add_trait_demon_effect = yes
			if = {
				limit = { culture = shivarra }
				culture = annihilan 
			}
		}
		else_if = {
			limit = { potential_race_nathrezim_trigger = yes }
			add_trait = creature_nathrezim
			add_trait_demon_effect = yes
			if = {
				limit = { culture = sayaadi }
				culture = nathrezim
			}
		}
		else_if = {
			limit = { potential_race_lothraxim_trigger = yes }
			add_trait = creature_lothraxim
			add_trait_demon_effect = yes
		}
		else_if = {
			limit = { potential_race_eredruin_trigger = yes }
			add_trait = creature_eredruin
			add_trait_demon_effect = yes
		}
		else_if = {
			limit = { potential_race_fel_orc_trigger = yes }
			add_trait = creature_fel_orc
		}
		else_if = {
			limit = { potential_race_felblood_elf_trigger = yes }
			add_trait = creature_felblood_elf
		}
		else_if = {
			limit = { potential_race_satyr_trigger = yes }
			add_trait = creature_satyr
			add_trait_demon_effect = yes
		}
		else_if = {
			limit = { potential_race_eredar_trigger = yes }
			add_trait = creature_eredar
			add_trait_demon_effect = yes
		}
		else_if = {
			limit = { potential_race_sayaadi_trigger = yes }
			add_trait = creature_sayaadi
			add_trait_demon_effect = yes
			if = {
				limit = { culture = nathrezim }
				culture = sayaadi 
			}
		}
		else_if = {
			limit = { potential_race_shivarra_trigger = yes }
			add_trait = creature_shivarra
			add_trait_demon_effect = yes
			if = {
				limit = { culture = annihilan }
				culture = shivarra 
			}
		}
		else_if = {
			limit = { potential_race_moarg_trigger = yes }
			add_trait = creature_moarg
			add_trait_demon_effect = yes
		}
		else_if = {
			limit = { potential_race_observer_trigger = yes }
			add_trait = creature_observer
			add_trait_demon_effect = yes
		}
		else_if = {
			limit = { potential_race_air_elemental_trigger = yes }
			add_trait = creature_air_elemental
		}
		else_if = {
			limit = { potential_race_earth_elemental_trigger = yes }
			add_trait = creature_earth_elemental
		}
		else_if = {
			limit = { potential_race_fire_elemental_trigger = yes }
			add_trait = creature_fire_elemental
		}
		else_if = {
			limit = { potential_race_flamewaker_trigger = yes }
			add_trait = creature_flamewaker
		}
		else_if = {
			limit = { potential_race_water_elemental_trigger = yes }
			add_trait = creature_water_elemental
		}
		else_if = {
			limit = { potential_race_iron_dwarf_trigger = yes }
			add_trait = creature_iron_dwarf
		}
		else_if = {
			limit = { potential_race_vrykul_trigger = yes }
			add_trait = creature_vrykul
			# if = {
				# limit = {
					# OR = {
						# is_ruler = no
						# tier = BARON
					# }
					# top_liege = { trait = sleeping_trait }
				# }
				# add_trait = sleeping_trait
			# }
		}
		else_if = {
			limit = { potential_race_tuskarr_trigger = yes }
			add_trait = creature_tuskarr
		}
		else_if = {
			limit = { potential_race_magnataur_trigger = yes }
			add_trait = creature_magnataur
		}
		else_if = {
			limit = { potential_race_furbolg_trigger = yes }
			add_trait = creature_furbolg
		}
		else_if = {
			limit = { potential_race_gorloc_trigger = yes }
			add_trait = creature_gorloc
		}
		else_if = {
			limit = { potential_race_watcher_trigger = yes }
			add_trait = creature_watcher
		}
		else_if = {
			limit = { potential_race_wolvar_trigger = yes }
			add_trait = creature_wolvar
		}
		else_if = {
			limit = { potential_race_taunka_trigger = yes }
			add_trait = creature_taunka
		}
		else_if = {
			limit = { potential_race_kvaldir_trigger = yes }
			add_trait = creature_kvaldir
			add_trait_undead_effect = yes
		}
		else_if = {
			limit = { potential_race_nerubian_trigger = yes }
			add_trait = creature_nerubian
		}
		else_if = {
			limit = { potential_race_harpy_trigger = yes }
			add_trait = creature_harpy
		}
		else_if = {
			limit = { potential_race_mechagnome_trigger = yes }
			add_trait = creature_mechagnome
		}
		else_if = {
			limit = { potential_race_earthen_trigger = yes }
			add_trait = creature_earthen
		}
		else_if = {
			limit = { potential_race_giant_trigger = yes }
			add_trait = creature_giant
		}
		else_if = {
			limit = { potential_race_nraqi_trigger = yes }
			add_trait = creature_nraqi
			add_trait_void_creature_effect = yes
		}
		else_if = {
			limit = { potential_race_cthraxxi_trigger = yes }
			add_trait = creature_cthraxxi
			add_trait_void_creature_effect = yes
		}
		else_if = {
			limit = { potential_race_night_elf_trigger = yes }
			add_trait = creature_night_elf
		}
		else_if = {
			limit = { potential_race_tauren_trigger = yes }
			add_trait = creature_tauren
		}
		else_if = {
			limit = { potential_race_centaur_trigger = yes }
			add_trait = creature_centaur
		}
		else_if = {
			limit = { potential_race_quilboar_trigger = yes }
			add_trait = creature_quilboar
		}
		else_if = {
			limit = { potential_race_tolvir_trigger = yes }
			add_trait = creature_tolvir
		}
		else_if = {
			limit = { potential_race_qiraji_trigger = yes }
			add_trait = creature_qiraji
			add_trait_void_creature_effect = yes
			
			# Qiraji can pick only C'Thun
			if = {
				limit = { is_locked_qiraji_trigger = yes }
				add_character_modifier = {
					name = follower_of_cthun
					duration = -1
				}
			}
		}
		else_if = {
			limit = { potential_race_dryad_trigger = yes }
			add_trait = creature_dryad
		}
		else_if = {
			limit = { potential_race_frostnymph_trigger = yes }
			add_trait = creature_frostnymph
		}
		else_if = {
			limit = { potential_race_highborne_trigger = yes }
			add_trait = creature_highborne
		}
		else_if = {
			limit = { potential_race_vulpera_trigger = yes }
			add_trait = creature_vulpera
		}
		else_if = {
			limit = { potential_race_sethrak_trigger = yes }
			add_trait = creature_sethrak
		}
		else_if = {
			limit = { potential_race_protector_trigger = yes }
			add_trait = creature_protector 
		}
		else_if = {
			limit = { potential_race_ancient_war_trigger = yes }
			add_trait = creature_ancient_war
			culture = protector
		}
		else_if = {
			limit = { potential_race_ancient_lore_trigger = yes }
			add_trait = creature_ancient_lore
			culture = protector
		}
		else_if = {
			limit = { potential_race_ancient_wind_trigger = yes }
			add_trait = creature_ancient_wind
			culture = protector
		}
		else_if = {
			limit = { potential_race_pandaren_trigger = yes }
			add_trait = creature_pandaren
		}
		else_if = {
			limit = { potential_race_jinyu_trigger = yes }
			add_trait = creature_jinyu
		}
		else_if = {
			limit = { potential_race_ankoan_trigger = yes }
			add_trait = creature_ankoan
		}
		else_if = {
			limit = { potential_race_mogu_trigger = yes }
			add_trait = creature_mogu
		}
		else_if = {
			limit = { potential_race_saurok_trigger = yes }
			add_trait = creature_saurok
		}
		else_if = {
			limit = { potential_race_grummle_trigger = yes }
			add_trait = creature_grummle
		}
		else_if = {
			limit = { potential_race_mantid_trigger = yes }
			add_trait = creature_mantid
			add_trait_void_creature_effect = yes
		}
		else_if = {
			limit = { potential_race_yaungol_trigger = yes }
			add_trait = creature_yaungol
		}
		else_if = {
			limit = { potential_race_stone_tolvir_trigger = yes }
			add_trait = creature_stone_tolvir
		}
		else = {
			gfx_culture_scope = { save_event_target_as = target_gfx_culture }
			log = "(IMPORTANT) [This.GetBestName] couldn't get race trait. GFX culture is [target_gfx_culture.GetName]."
			clear_event_target = target_gfx_culture
			if = {
				limit = { has_character_flag = last_race_try_flag }
				death = { death_reason = death_missing }
				break = yes
			}
			set_character_flag = last_race_try_flag
			
			dynasty_head = { ROOT = { set_prev_gfx_effect = yes } }
			repeat_event = { id = WCRAC.10 }
			break = yes
		}
		
		# Adds blood trait
		add_blood_trait_effect = yes
		
		# Changes gender
		if = {
			limit = {
				is_female = yes
				is_only_male_race_trigger = yes
			}
			set_gender = male
		}
		else_if = {
			limit = {
				is_female = no
				is_only_female_race_trigger = yes
			}
			set_gender = female
		}
		
		# Adds undead trait
		if = {
			limit = {
				NOT = { trait = being_undead }
				
				OR = {
					has_undead_gfx_trigger = yes
					AND = {
						can_be_undead_trigger = yes
						location = { has_province_modifier = undead_province }
						liege = { trait = being_undead }
					}
				}
			}
			save_event_target_as = target_necromancer
			character_event = { id = WCPOD.5013 }
		}
		# Adds demon trait
		if = {	
			limit = {
				NOT = { trait = being_demon }
				
				has_demon_gfx_trigger = yes				
			}
			add_trait_demon_effect = yes
		}
		
		# Adds tattoos
		add_random_tattoo_effect = yes
		
		# Adds default traits when new character spawns
		add_default_traits = yes
		# Adds religious branch
		if = {
			limit = { religion_has_branches_trigger = yes }
			liege = { ROOT = { add_prev_religious_branch_or_random_effect = yes } }
		}
		
		# Fixes immortal age
		add_age_back_effect = yes
		
		clr_character_flag = no_show_what_become_flag			# Works only during this event
		clr_character_flag = no_religion_change_flag			# Works only during this event

		clr_character_flag = race_delay_flag					# Race trait is added, so no longer needed
	}
}

# Fixes child portraits of immortal characters
character_event = {
	id = WCRAC.200
	
	is_triggered_only = yes
	hide_window = yes
	
	min_age = 16
	
	trigger = {
		age = 16
	}

	immediate = {
		log = "WCRAC.200 fired for [Root.GetBestName]"
		
		remove_racial_traits_effect = yes
		remove_class_trait_effect = yes
		character_event = { id = WCRAC.10 }
		add_class_trait_effect = yes
	}
}

# New ancient born
character_event = {
	id = WCRAC.310
	desc = EVTDESC_WCRAC.310
	picture = GFX_evt_emerald_dream
	border = GFX_event_normal_frame_diplomacy
	
	is_triggered_only = yes
	
	trigger = {
		is_playable = yes
		
		is_plant_race_trigger = yes
		
		has_artifact = ancient_kernel
	}
	
	immediate = {
		destroy_artifact = ancient_kernel
		create_character = {
			dynasty = ROOT
			religion = ROOT
			culture = ROOT
			female = 50
			age = 0
			flag = race_delay_flag
		}
		new_character = {
			random_list = {
				10 = { set_graphical_culture = protector }
				10 = { set_graphical_culture = ancient_war }
				10 = { set_graphical_culture = ancient_lore }
				10 = { set_graphical_culture = ancient_wind }
			}
			character_event = { id = WCRAC.10 } 	# Adds race trait
			
			if = {
				limit = { ROOT = { is_female = yes } }
				set_mother = ROOT
			}
			else = {
				set_father = ROOT
			}
		}
	}
	
	option = {
		name = EVTOPTA_WCRAC.310
	}
}
# Destory Ancients seed after death
character_event = {
	id = WCRAC.320

	is_triggered_only = yes
	hide_window = yes

	trigger = {
		has_artifact = ancient_kernel
	}

	immediate = {
		destroy_artifact = ancient_kernel
	}
}

# on_marriage
# Marriages make infertile :3
character_event = {
	id = WCRAC.395
	
	is_triggered_only = yes
	hide_window = yes
	
	trigger = {
		FROM = { need_infertile_trait_trigger = yes }
	}
	
	immediate = {
		FROM = { character_event = { id = WCRAC.400 months = 1 random = 60 } }
	}
}
# on_birth
# Child makes parents infertile :3
character_event = {
	id = WCRAC.399
	
	is_triggered_only = yes
	hide_window = yes
	
	immediate = {
		true_father = {
			if = {
				limit = {
					need_infertile_trait_trigger = yes
				}
				character_event = { id = WCRAC.400 months = 1 random = 60 }
			}
		}
		mother = {
			if = {
				limit = {
					need_infertile_trait_trigger = yes
				}
				character_event = { id = WCRAC.400 months = 1 random = 60 }
			}
		}
	}
}
# Becomes infertile
character_event = {
	id = WCRAC.400
	desc = EVTDESC_WCRAC_400
	picture = GFX_evt_marriage
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	hide_from = yes
	
	trigger = {
		need_infertile_trait_trigger = yes
	}
	
	immediate = {
		add_trait = infertile
	}
	
	option = {
		name = ALAS
		
		tooltip = {
			add_trait = infertile
		}
	}
}

### Spiritbinding
# Starts building new vessel, picks rock
character_event = {
	id = WCRAC.500
	desc = EVTDESC_WCRAC_500
	picture = GFX_evt_jade_mogu_golem
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	#Soft
	option = {
		name = EVTOPTA_WCRAC_500
		
		random_list = {
			10 = {
				custom_tooltip = {
					text = spiritbinding_deformed_body_tooltip
					set_character_flag = spiritbinding_deformed_body_flag
				}
			}
			10 = {
				custom_tooltip = {
					text = spiritbinding_excellent_body_tooltip
					set_character_flag = spiritbinding_excellent_body_flag
				}
			}
			80 = {
			}
		}
	}
	#Hard
	option = {
		name = EVTOPTB_WCRAC_500
		
		random_list = {
			30 = {
				custom_tooltip = {
					text = spiritbinding_deformed_body_tooltip
					set_character_flag = spiritbinding_deformed_body_flag
				}
			}
			30 = {
				custom_tooltip = {
					text = spiritbinding_excellent_body_tooltip
					set_character_flag = spiritbinding_excellent_body_flag
				}
			}
			40 = {
			}
		}
	}
	after = {
		character_event = { id = WCRAC.505 months = 6 random = 180 }
	}
}
#Body is ready
character_event = {
	id = WCRAC.505
	desc = EVTDESC_WCRAC_505
	picture = GFX_evt_jade_mogu_golem
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	#Begin the ritual
	option = {
		name = {
			trigger = { NOT = { has_character_flag = spiritbinding_deformed_body_flag } }
			text = EVTOPTA_WCRAC_505_normal
		}
		name = {
			trigger = { has_character_flag = spiritbinding_deformed_body_flag }
			text = EVTOPTA_WCRAC_505_fail
		}
		
		random_list = {
			90 = {
				custom_tooltip = {
					text = spiritbinding_soul_transferred_tooltip
				}
			}
			10 = {
				custom_tooltip = {
					text = spiritbinding_soul_trapped_tooltip
					set_character_flag = spiritbinding_soul_trapped_flag
				}
			}
		}
		
		character_event = { id = WCRAC.510 days = 3 }
	}
	#Stop it
	option = {
		name = {
			trigger = { NOT = { has_character_flag = spiritbinding_deformed_body_flag } }
			text = EVTOPTB_WCRAC_505_normal
		}
		name = {
			trigger = { has_character_flag = spiritbinding_deformed_body_flag }
			text = EVTOPTB_WCRAC_505_fail
		}
		
		clear_flags_with_prefix = spiritbinding_
	}
}
#Ritual begins
character_event = {
	id = WCRAC.510
	desc = EVTDESC_WCRAC_510
	picture = GFX_evt_jade_mogu_golem
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	#You died
	option = {
		trigger = { has_character_flag = spiritbinding_soul_trapped_flag }
		name = EVTOPTA_WCRAC_510
		
		death = { death_reason = death_accident }
	}
	#Got new body
	option = {
		trigger = { NOT = { has_character_flag = spiritbinding_soul_trapped_flag } }
		name = EXCELLENT
		
		get_new_body_effect = yes
		
		if = {
			limit = { has_character_flag = spiritbinding_deformed_body_flag }
			add_trait = weak
		}
		if = {
			limit = { has_character_flag = spiritbinding_excellent_body_flag }
			add_trait = strong
		}
	}
	
	after = {
		clear_flags_with_prefix = spiritbinding_
	}
}

### Mantid Paragons ###
### The Klaxxi pick paragons
character_event = {
	id = WCRAC.1000
	
	is_triggered_only = yes
	hide_window = yes
	
	only_playable = yes
	religion = old_gods_worship
	
	trigger = {
		is_playable = yes
		
		religion = old_gods_worship
		
		has_landed_title = d_klaxxi
	}
	
	immediate = {
		any_playable_ruler = {
			limit = {
				#NOT = { character = ROOT } # Can't pick themselves	#Doesn't ignore you if you fire it via console
				NOT = { has_character_flag = mantid_paragon_happend_flag }
				
				is_worth_to_be_mantid_paragon_trigger = yes
			}
			count = 1
			score_value = {
				value = 0
				has_diplomacy_5_per_5_positive_score = yes
				has_martial_5_per_5_positive_score = yes
				has_stewardship_5_per_5_positive_score = yes
				has_intrigue_5_per_5_positive_score = yes
				has_learning_5_per_5_positive_score = yes
				has_combat_rating_10_per_5_positive_score = yes
			}
			
			log = "(MANTID) [This.GetBestName] is picked to be paragon"
			
			set_character_flag = mantid_paragon_happend_flag #Once in life
			
			character_event = { id = WCRAC.1005 days = 3 random = 27 }
		}
	}
}
### The Klaxxi want you to be a paragon
character_event = {
	id = WCRAC.1005
	title = EVTTITLE_WCRAC_1005
	desc = EVTDESC_WCRAC_1005
	picture = GFX_evt_emissary
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	trigger = {
		is_worth_to_be_mantid_paragon_trigger = yes
	}
	
	#The honour is mine.
	option = {
		name = EVTOPTA_WCRAC_1005
		
		character_event = { id = WCRAC.1010 days = 3 }
	}
	#I'm sorry, but my people need me here.
	option = {
		name = EVTOPTB_WCRAC_1005
		
		ai_chance = {
			factor = 0
		}
	}
}
### The ritual begins, your ambersmith is killed
long_character_event = {
	id = WCRAC.1010
	title = EVTTITLE_WCRAC_1005
	desc = EVTDESC_WCRAC_1010
	picture = GFX_evt_emissary
	border = GFX_event_long_frame_religion
	
	is_triggered_only = yes
	
	trigger = {
		is_worth_to_be_mantid_paragon_trigger = yes
	}
	
	immediate = {
		hidden_effect = {
			save_event_target_as = target_paragon
		}
	}
	
	#So wake me up when it's all over...
	option = {
		name = EVTOPTA_WCRAC_1010
		
		add_character_modifier = { name = recently_became_paragon_cooldown years = 50 hidden = yes }
		
		add_trait = mantid_paragon
		put_to_sleep_paragon_effect = yes
		if = {
			limit = { NOT = { any_owned_bloodline = { has_character_flag = weak_earned_bloodline } } }
			if = { 
				limit = { is_female = no }
				create_bloodline = { type = mantid_paragon_bloodline }		
			}
			else = {
				create_bloodline = { type = mantid_paragon_bloodline inheritance = matrilineal }		
			}
		}
		if = {
			limit = { has_nickname = no }
			assign_random_mantid_paragon_nickname_effect = yes
		}
		
		current_heir = {
			show_scope_change = no
			save_event_target_as = target_new_ruler
			
			ROOT = {
				show_scope_change = no
				
				this_abdicate_transfer_wealth_to_prev_effect = yes
			}
		}
		
		hidden_effect = {
			any_player = {
				limit = {
					religion = old_gods_worship
					culture = mantid
					
					NOT = {
						character = ROOT
						character = event_target:target_new_ruler
					}
				}
				character_event = { id = WCRAC.1013 }
			}
		}
	}
}
### Notification: the Klaxxi has chosen her/him to be a paragon
character_event = {
	id = WCRAC.1013
	title = EVTTITLE_WCRAC_1013
	desc = EVTDESC_WCRAC_1013
	picture = GFX_evt_emissary
	border = GFX_event_normal_frame_religion
	portrait = event_target:target_paragon
	
	is_triggered_only = yes
	
	option = {
		name = INTERESTING
	}
}
### The Klaxxi reawakes the paragon
#Delayer event
character_event = {
	id = WCRAC.1015
	
	is_triggered_only = yes
	hide_window = yes
	
	trigger = {
		NOT = { has_character_flag = awaken_paragon_ongoing_flag }
	}
	
	immediate = {
		set_character_flag = awaken_paragon_ongoing_flag
		
		character_event = { id = WCRAC.1019 }
	}
}
#Delayed event
character_event = {
	id = WCRAC.1019
	
	is_triggered_only = yes
	hide_window = yes
	
	trigger = {
		is_ruler = no
		
		trait = sleeping_trait
		has_character_flag = paragon_sleeping_flag
		
		liege = {
			religion = old_gods_worship
			culture = mantid
		}
	}
	
	fail_trigger_effect = {
		death = { death_reason = death_accident }
	}
	
	immediate = {
		save_event_target_as = target_paragon
		
		liege = { character_event = { id = WCRAC.1020 } }
	}
}
#Pinged event
character_event = {
	id = WCRAC.1020
	title = EVTTITLE_WCRAC_1005
	desc = EVTDESC_WCRAC_1020
	picture = GFX_evt_emissary
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_WCRAC_1020
		
		event_target:target_paragon = {
			show_scope_change = no
			
			if = {
				limit = { prisoner = yes }
				imprison = no
			}
			
			awaken_paragon_effect = yes
			
			move_character = ROOT
		}
		
		ai_chance = {
			factor = 1
		}
	}
	option = {
		trigger = { dynasty = event_target:target_paragon }
		name = EVTOPTB_WCRAC_1020
		
		event_target:target_paragon = {
			show_scope_change = no
			
			if = {
				limit = { prisoner = yes }
				imprison = no
			}
			
			awaken_paragon_effect = yes
			
			move_character = ROOT
			
			ROOT = {
				show_scope_change = no
				
				this_abdicate_transfer_wealth_to_play_prev_effect = yes
			}
		}
		
		ai_chance = {
			factor = 99
			modifier = {
				factor = 0
				trait = mantid_paragon
			}
		}
	}
	
	after = {
		FROM = { clr_character_flag = awaken_paragon_ongoing_flag }
	}
}

# Fixes nathrezim and sayaadi appearing young adult
character_event = {
	id = WCRAC.1040
	
	hide_window = yes
	
	min_age = 30

	culture_group = demonic_group
	
	trigger = {
		age = 30
		
		NOT = { has_character_flag = mid_age_nathrezim_flag }

		AND = {				
			OR = {	
				trait = creature_nathrezim
				trait = creature_sayaadi
			}
		}	
	}
	mean_time_to_happen = {
	days = 1
	}
	
	immediate = {
		log = "WCRAC.1040 fired for [Root.GetBestName]"
		
		remove_racial_traits_effect = yes
		remove_trait = being_demon
		character_event = { id = WCRAC.10 }
		set_character_flag = mid_age_nathrezim_flag
	}
}

# Fixes lothraxim portraits
character_event = {
	id = WCRAC.1050
	
	hide_window = yes
	
	min_age = 30

	max_age = 32
	
	trigger = {
		age = 30
		
		trait = creature_lothraxim

		NOT = { has_character_flag = mid_age_lothraxim_flag }

		NOT = { is_pregnant = yes }
	}
	mean_time_to_happen = {
	days = 1
	}
	
	immediate = {
		log = "WCRAC.1050 fired for [Root.GetBestName]"
		
		remove_racial_traits_effect = yes
		remove_trait = being_demon
		character_event = { id = WCRAC.10 }
		set_character_flag = mid_age_lothraxim_flag
	}
}

# Fixes old lothraxim portraits
character_event = {
	id = WCRAC.1060
	
	hide_window = yes
	
	min_age = 50

	max_age = 52
	
	trigger = {
		age = 50
		
		trait = creature_lothraxim

		NOT = { has_character_flag = old_age_lothraxim_flag }

		NOT = { is_pregnant = yes }
	}
	mean_time_to_happen = {
	days = 1
	}
	
	immediate = {
		log = "WCRAC.1060 fired for [Root.GetBestName]"
		
		remove_trait = creature_lothraxim
		remove_trait = being_demon
		character_event = { id = WCRAC.10 }
		set_character_flag = old_age_lothraxim_flag
	}
}

# Converts Nathrezim and Sayaadi to Lothraxim
character_event = {
	id = WCRAC.1070
	title = EVTTITLE_WCRAC_1070
	desc = EVTDESC_WCRAC_1070
	picture = GFX_evt_Lothraxion
	border = GFX_event_normal_frame_religion
	hide_window = no
	
	trigger = {

		religion_group = light_group

		NOT = { is_pregnant = yes }

		NOT = { has_character_flag = rejected_lothraxim_flag }
		
		AND = {				
			OR = {	
				trait = creature_nathrezim
				trait = creature_sayaadi
			}
		}

	}
	mean_time_to_happen = {
	days = 30
	}

	option = {
	
	#Accept = {
		name = EVTOPTA_WCRAC_1070

		remove_racial_traits_effect = yes
		add_trait = creature_lothraxim

		ai_chance = {
			factor = 2
		}
	}	

	option = {

	#Reject = {
		name = EVTOPTB_WCRAC_1070
		set_character_flag = rejected_lothraxim_flag

		ai_chance = {
			factor = .25
			modifier = {
				factor = 2
				trait = proud
			}
			modifier = {
				factor = 2
				trait = stubborn
			}
		}
	}
}
# Clears rejected_lothraxim_flag
character_event = {
	id = WCRAC.1075
	
	hide_window = yes
	
	trigger = {
		had_character_flag = {
    			flag = rejected_lothraxim_flag
   			years >= 5
		}
		NOT = { is_pregnant = yes }
	}
	mean_time_to_happen = {
	days = 1
	}
	
	immediate = {

		clr_character_flag = rejected_lothraxim_flag
	}
}
# Converts Lothraxim to Nathrezim
character_event = {
	id = WCRAC.1080
	title = EVTTITLE_WCRAC_1080
	desc = EVTDESC_WCRAC_1080
	picture = GFX_evt_Corruption
	border = GFX_event_normal_frame_religion
	hide_window = no
	
	trigger = {

		trait = creature_lothraxim

		is_female = no
		
		AND = {				
			OR = {	
				religion = death_god
				religion = orcish_fel
				religion = burning_legion_religion
				religion = old_gods_worship
				religion_group = fel_group
				religion_group = necromancy_group
				religion_group = void_group
				religion = forsaken_cult
				religion = cult_of_hakkar
				religion = helya
			}
		}
	}
	mean_time_to_happen = {
	days = 30
	}

	option = {
	
	#Pleased = {
		name = EVTOPTA_WCRAC_1080

		remove_racial_traits_effect = yes
		add_trait = creature_nathrezim

		random = {
			chance = 90
			add_trait = ambitious
		}

		random = {
			chance = 10
			add_trait = wounded
		}		
	}	

	option = {
	
	#Displeased = {
		name = EVTOPTB_WCRAC_1080

		remove_racial_traits_effect = yes
		add_trait = creature_nathrezim

		random = {
			chance = 50
			add_trait = depressed
		}	
	}		

	option = {

	#Penitent = {
		name = EVTOPTC_WCRAC_1080
		religion = holy_light
	}
}
# Converts Lothraxim to Sayaadi
character_event = {
	id = WCRAC.1085
	title = EVTTITLE_WCRAC_1085
	desc = EVTDESC_WCRAC_1085
	picture = GFX_evt_Corruption
	border = GFX_event_normal_frame_religion
	hide_window = no
	
	trigger = {

		trait = creature_lothraxim

		is_female = yes

		is_pregnant = no
		
		AND = {				
			OR = {	
				religion = death_god
				religion = orcish_fel
				religion = burning_legion_religion
				religion = old_gods_worship
				religion_group = fel_group
				religion_group = necromancy_group
				religion_group = void_group
				religion = forsaken_cult
				religion = cult_of_hakkar
				religion = helya
			}
		}
	}
	mean_time_to_happen = {
	days = 30
	}

	option = {
	
	#Pleased = {
		name = EVTOPTA_WCRAC_1085

		remove_racial_traits_effect = yes
		add_trait = creature_sayaadi

		random = {
			chance = 90
			add_trait = ambitious
		}

		random = {
			chance = 10
			add_trait = wounded
		}		
	}	

	option = {
	
	#Displeased = {
		name = EVTOPTB_WCRAC_1085

		remove_racial_traits_effect = yes
		add_trait = creature_sayaadi

		random = {
			chance = 50
			add_trait = depressed
		}	
	}		

	option = {

	#Penitent = {
		name = EVTOPTC_WCRAC_1085
		religion = holy_light
	}
}

#YOUR CHILD HAS ELF LOVER
character_event = {
	id = WCRAC.1090
	hide_window = yes
	
	trigger = {
		has_game_rule = {
				name = lothraxim_family
				value = on
		}
		trait = creature_lothraxim
		NOT = { has_character_flag = daughter_danced_flag }
		is_female = no
		any_child = {
				is_female = yes
				can_marry_trigger = yes
				is_married = no
				is_betrothed = no
				is_consort = no
				has_lover = no
				trait = creature_lothraxim
				age = 16
				age < 30
				NOT = { trait = content }
				NOT = { trait = chaste }
				NOT = { trait = celibate }
				at_location = ROOT	
		}
	}

		mean_time_to_happen = { 
		months = 12 
		}

		immediate = {
			set_character_flag = daughter_danced_flag
			set_character_flag = dance_child_has_lover
			save_event_target_as = dance_parent
			random_child = {
				limit = {
					# Warcraft
					is_female = yes
					can_marry_trigger = yes
					is_married = no
					is_betrothed = no
					is_consort = no
					has_lover = no
					trait = creature_lothraxim
					age = 16
					age < 30
					NOT = { trait = content }
					NOT = { trait = chaste }
					NOT = { trait = celibate }
					at_location = ROOT
			}
			save_event_target_as = dance_child
		}
		event_target:dance_child = { character_event = { id = WCRAC.1091 } }
		}
}

#Child dances
character_event = {
	id = WCRAC.1091
	hide_window = yes
	is_triggered_only = yes

	option = {
		FROM = { character_event =  { id = WCRAC.1092 } }
	}
}
	
#Child dances response
character_event = {
	id = WCRAC.1092
	title = EVTTITLE_WCRAC_1092
	picture = GFX_evt_Lothraxim_Dance
	desc = EVTDESC_WCRAC_1092
	border = GFX_event_normal_frame_intrigue
	is_triggered_only = yes

	option = {
		name = EVTOPTA_WCRAC_1092
		hidden_tooltip = { FROM = { character_event = { id = WCRAC.1093} } }
	}
		
	option = {
		name = EVTOPTB_WCRAC_1092
		hidden_tooltip = { FROM = { character_event = { id = WCRAC.1093} } }
	}
}

#Child falls in love
character_event = {
	id = WCRAC.1093
	hide_window = yes
	is_triggered_only = yes

	option = {
		if = {
			limit = { prefers_men_trigger = yes }
			create_character = {
				graphical_culture = highelfgfx
				trait = creature_high_elf
				culture = high_elf
				age = 21
				female = no
				dynasty = none
				random_traits = yes
			}
		}
		if = {
			limit = { prefers_men_trigger = no }
			create_character = {
				age = 21
				female = yes
				dynasty = none
				random_traits = yes
			}
		}
		new_character = {
			add_trait = lustful
			add_trait = fair
			add_trait = strong
			add_trait = quick
			add_trait = seducer
			add_trait = gregarious
			remove_trait = chaste
			remove_trait = ugly
			save_event_target_as = dance_childs_lover
			
			if = {
				limit = { ROOT = { trait = homosexual } }
				add_trait = homosexual
			}

			# Warcraft
			ROOT = { add_lover_prev_effect = yes }
		}
		
		FROM = { character_event =  { id = WCRAC.1094 days = 7 } }	
	}
}

#Child returns with lover
character_event = {
	id = WCRAC.1094
	title = EVTTITLE_WCRAC_1094
	desc = EVTDESC_WCRAC_1094
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Lothraxim_Dance
	
	is_triggered_only = yes

	#Stay and get married angry father
	option = {
		
		name = EVTOPTA_WCRAC_1094
		FROM = {
			if = {
				limit = { is_female = yes }

				# Warcraft
				event_target:dance_childs_lover = { prev_add_spouse_matrilineal_this_effect = yes }
			}
			if = {
				limit = { is_female = no }

				# Warcraft
				event_target:dance_childs_lover = { prev_add_spouse_this_effect = yes }
			}
		}
			add_trait = wroth
	}

	#Stay and get married accepting father

	option = {
		
		name = EVTOPTB_WCRAC_1094
		FROM = {
			if = {
				limit = { is_female = yes }

				# Warcraft
				event_target:dance_childs_lover = { prev_add_spouse_matrilineal_this_effect = yes }
			}
			if = {
				limit = { is_female = no }

				# Warcraft
				event_target:dance_childs_lover = { prev_add_spouse_this_effect = yes }
			}
		}
				add_trait = patient
	}
	
}

# Clears daughter_danced_flag
character_event = {
	id = WCRAC.1095
	
	hide_window = yes
	
	trigger = {
		had_character_flag = {
    			flag = daughter_danced_flag
   			years >= 20
		}
	}
	mean_time_to_happen = {
	days = 1
	}
	
	immediate = {

		clr_character_flag = daughter_danced_flag
	}
}

#Lothraxim Female Comes of Age
character_event = {
	id = WCRAC.1100
	title = EVTTITLE_WCRAC_1100
	desc = EVTDESC_WCRAC_1100
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Sayaad_Mirror
	
	trigger = {
		has_game_rule = {
				name = lothraxim_family
				value = on
		}
		trait = creature_lothraxim
		is_female = yes
		NOR = { has_character_flag = came_of_age_flag
			has_character_flag = is_sarielle
		}
		age = 16
		age < 20
	}
	
	mean_time_to_happen = { 
		days = 30 
		}

		immediate = {
			set_character_flag = came_of_age_flag
		}

	#Choose Beauty
	
	option = {
		
		name = EVTOPTA_WCRAC_1100
		
		random = {
			chance = 40
			add_trait = seductress
		}
		random = {
			chance = 40
			add_trait = fair
		}
		random = {
			chance = 40
			add_trait = groomed
		}
		
		ai_chance = {
			factor = 2
		}
	}

	##Choose Personality

	option = {
		
		name = EVTOPTB_WCRAC_1100
		
		random = {
			chance = 30
			add_trait = kind
		}
		
		random = {
			chance = 30
			add_trait = patient
		}
		
		random = {
			chance = 30
			add_trait = gregarious
		}

		random = {
			chance = 30
			add_trait = gamer
		}

		ai_chance = {
			factor = 1
		}
	}

	#Choose Dominance
	
	option = {
		
		name = EVTOPTC_WCRAC_1100
		
		random = {
			chance = 30
			add_trait = impaler
		}

		random = {
			chance = 30
			add_trait = hedonist
		}

		random = {
			chance = 30
			add_trait = cruel
		}

		random = {
			chance = 30
			add_trait = lustful
		}

		ai_chance = {
			factor = 1
		}
	}

	#Choose Another Path
	
	option = {
		
		name = EVTOPTD_WCRAC_1100
		
		random = {
			chance = 20
			add_trait = zealous
		}	
		
		random = {
			chance = 20
			add_trait = shrewd
		}	

		random = {
			chance = 20
			add_trait = ambitious
		}	

		random = {
			chance = 20
			add_trait = chaste
		}	

		random = {
			chance = 20
			add_trait = temperate
		}	

		random = {
			chance = 20
			add_trait = diligent
		}		
	
		ai_chance = {
			factor = 1
		}

	}
	
}

#Lothraxim Male Comes of Age
character_event = {
	id = WCRAC.1101
	title = EVTTITLE_WCRAC_1101
	desc = EVTDESC_WCRAC_1101
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Nathrezim_Mirror
	
	trigger = {
		has_game_rule = {
				name = lothraxim_family
				value = on
		}
		trait = creature_lothraxim
		is_female = no
		NOR = { has_character_flag = came_of_age_flag
			has_character_flag = is_lothraxus
		}
		age = 16
		age < 20
	}
	
	mean_time_to_happen = { 
		days = 30 
		}

		immediate = {
			set_character_flag = came_of_age_flag
		}

	#Choose Cunning
	
	option = {
		
		name = EVTOPTA_WCRAC_1101
		
		random = {
			chance = 30
			add_trait = shrewd
		}
		random = {
			chance = 30
			add_trait = ambitious
		}
		random = {
			chance = 30
			add_trait = schemer
		}
		random = {
			chance = 30
			add_trait = deceitful
		}

		ai_chance = {
			factor = 2
		}
	}

	##Choose Strength

	option = {
		
		name = EVTOPTB_WCRAC_1101
		
		random = {
			chance = 30
			add_trait = strong
		}
		
		random = {
			chance = 30
			add_trait = robust
		}
		
		random = {
			chance = 30
			add_trait = duelist
		}

		random = {
			chance = 30
			add_trait = brave
		}

		ai_chance = {
			factor = 1
		}
	}

	#Choose Diplomacy
	
	option = {
		
		name = EVTOPTC_WCRAC_1101
		
		random = {
			chance = 40
			add_trait = gregarious
		}

		random = {
			chance = 40
			add_trait = socializer
		}

		random = {
			chance = 40
			add_trait = poet
		}

		ai_chance = {
			factor = 1
		}
	}

	#Choose Another Path
	
	option = {
		
		name = EVTOPTD_WCRAC_1101
		
		random = {
			chance = 20
			add_trait = zealous
		}	
		
		random = {
			chance = 20
			add_trait = erudite
		}	

		random = {
			chance = 20
			add_trait = humble
		}	

		random = {
			chance = 20
			add_trait = chaste
		}	

		random = {
			chance = 20
			add_trait = temperate
		}	

		random = {
			chance = 20
			add_trait = diligent
		}		
	
		ai_chance = {
			factor = 1
		}

	}
	
}

#Anti Demon Riot
character_event = {
	id = WCRAC.1110
	hide_window = no
	title = EVTTITLE_WCRAC_1110
	desc = EVTDESC_WCRAC_1110
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Antidemon_Riot
	
	trigger = {
		has_game_rule = {
				name = lothraxim_rebellions
				value = on
		}
		trait = creature_lothraxim
		is_adult = yes
		is_female = no
		NOT = { has_character_flag = antidemon_rioters_flag }
		is_landed = yes
		primary_title = {
    				higher_tier_than = count
		}			
	}

	mean_time_to_happen = { 
		years = 10 
		modifier = {
			factor = 1.5
			indepenedent = no
		}
		modifier = {
			factor = .5
			trait = cruel
		}
		modifier = {
			factor = .5
			trait = arbitrary
		}
		modifier = {
			factor = 1.5
			trait = just
		}
		modifier = {
			factor = 1.5
			any_owned_bloodline = { 
				has_bloodline_flag = lothraxim_redeemer_bloodline_flag
			}
		}
		modifier = {
			factor = 1.5
			any_owned_bloodline = { 
				AND = {
					has_bloodline_flag = end_of_legion_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
			}
		}
		modifier = {
			factor = 1.5
			any_owned_bloodline = { 
				AND = {
					has_bloodline_flag = end_of_scourge_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
			}
		}
		modifier = {
			factor = 1.5
			any_owned_bloodline = { 
				AND = {
					has_bloodline_flag = end_of_black_empire_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
			}
		}
	}
		
		immediate = {
			set_character_flag = antidemon_rioters_flag
		}

	#Fight	
	
	option = {
		
		name = EVTOPTA_WCRAC_1110

		tooltip_info_custom = EVTOPTA_WCRAC_1110_Tooltip
		
		random = {
			chance = 20
			add_trait = brave
		}
		
		if = {
   			limit = {
				combat_rating >= 100
			}
			random_list = {
				80 = {
					prestige = 50
					set_character_flag = fought_antidemon_rioters_flag
					clr_character_flag = antidemon_rioters_flag
					character_event = { id = WCRAC.1111 days = 2} 
				}
				15 = {
					add_character_modifier = {
					name = badly_bruised
					months = 60
					}
				}
				5 = {
					add_trait = wounded
				}
			}
		}				
		
		else_if = {
   			limit = {
				combat_rating >= 50
			}
			random_list = {
				40 = {
					set_character_flag = fought_antidemon_rioters_flag
					clr_character_flag = antidemon_rioters_flag
					character_event = { id = WCRAC.1111 days = 2} 
					increase_duel_exp_modifier_effect = yes
				}
				40 = {
					add_character_modifier = {
					name = badly_bruised
					months = 60
					}
				}
				20 = {
					add_trait = wounded
				}
			}				 
		}
		else = {
   			limit = {
				combat_rating <= 50
			}
			random_list = {
				20 = {
					set_character_flag = fought_antidemon_rioters_flag
					clr_character_flag = antidemon_rioters_flag
					character_event = { id = WCRAC.1111 days = 2} 
					increase_duel_exp_modifier_effect = yes
				}
				40 = {
					add_character_modifier = {
					name = badly_bruised
					months = 60
					}
				}
				40 = {
					add_trait = wounded
				}
			}				 
		}
		ai_chance = {
			factor = 1
			modifier = {
				factor = 2
				trait = wroth
			}
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 2
				combat_rating >= 100
			}
		}
	}

		
	#Flight

	option = {
		
		name = EVTOPTB_WCRAC_1110
		tooltip_info_custom = EVTOPTB_WCRAC_1110_Tooltip
		
		prestige = -100

		add_character_modifier = {
			name = cowardly_ruler
			months = 24
		}

		if = {
   			limit = {
				trait = brave
			}
			random = {
				chance = 10
				remove_trait = brave
			}
		}
		else = {
			random = {
				chance = 10
				add_trait = craven
			}
		}

		random = {
			chance = 90
			set_character_flag = fled_antidemon_rioters_flag
			clr_character_flag = antidemon_rioters_flag
			character_event = { id = WCRAC.1112 days = 2} 
		}
		ai_chance = {
			factor = 1
			modifier = {
				factor = 2
				trait = craven
			}
		}
	}

	#Just

	option = {
		
		name = EVTOPTC_WCRAC_1110
		tooltip_info_custom = EVTOPTC_WCRAC_1110_Tooltip

		if = {
			limit = {
				OR = {
					trait = just
					diplomacy >= 25
				}
			}
			random = {
				chance = 80
				set_character_flag = pacified_antidemon_rioters_flag
				clr_character_flag = antidemon_rioters_flag
				character_event = { id = WCRAC.1113 days = 2} 
			}
		}
		else_if = {
			limit = {
				diplomacy >= 10
			}
			random = {
				chance = 40
				set_character_flag = pacified_antidemon_rioters_flag
				clr_character_flag = antidemon_rioters_flag
				character_event = { id = WCRAC.1113 days = 2} 
			}
		}
		else = {
			random = {
				chance = 20
				set_character_flag = pacified_antidemon_rioters_flag
				clr_character_flag = antidemon_rioters_flag
				character_event = { id = WCRAC.1113 days = 2} 
			}
		}
		ai_chance = {
			factor = 1
			modifier = {
				factor = 2
				trait = just
			}
			modifier = {
				factor = 2
				diplomacy >= 25
			}
		}
		
	}

	#Zeal

	option = {
		
		name = EVTOPTD_WCRAC_1110
		tooltip_info_custom = EVTOPTD_WCRAC_1110_Tooltip
		
		trigger = {
			AND = {
				religion_group = light_group

				NOT = {
					trait = cynical
				}
				
				OR = { 
					trait = zealous
					
					any_owned_bloodline = { 
						has_bloodline_flag = lothraxim_redeemer_bloodline_flag
					}
					
					any_owned_bloodline = { 
						AND = {
							has_bloodline_flag = end_of_scourge_bloodline_flag
							founder = {
								trait = creature_lothraxim
							}
						}
					}
					any_owned_bloodline = { 
						AND = {
							has_bloodline_flag = end_of_legion_bloodline_flag
							founder = {
								trait = creature_lothraxim
							}
						}
					}				
					any_owned_bloodline = { 
						AND = {
							has_bloodline_flag =end_of_black_empire_bloodline_flag
							founder = {
								trait = creature_lothraxim
							}
						}
					}
				}
			}	
		}

		if = {
			limit = {
				OR = {
					any_owned_bloodline = { 
						has_bloodline_flag = lothraxim_redeemer_bloodline_flag
					}
					
					any_owned_bloodline = { 
						AND = {
							has_bloodline_flag = end_of_scourge_bloodline_flag
							founder = {
								trait = creature_lothraxim
							}
						}
					}
					any_owned_bloodline = { 
						AND = {
							has_bloodline_flag = end_of_legion_bloodline_flag
							founder = {
								trait = creature_lothraxim
							}
						}
					}				
					any_owned_bloodline = { 
						AND = {
							has_bloodline_flag =end_of_black_empire_bloodline_flag
							founder = {
								trait = creature_lothraxim
							}
						}
					}
				}
			}
			random = {
				chance = 95
				set_character_flag = pacified_antidemon_rioters_flag
				clr_character_flag = antidemon_rioters_flag
				character_event = { id = WCRAC.1170 days = 2} 
			}
		}
		else = {
			random = {
				chance = 80
				set_character_flag = pacified_antidemon_rioters_flag
				clr_character_flag = antidemon_rioters_flag
				character_event = { id = WCRAC.1113 days = 2} 
			}
		}
		ai_chance = {
			factor = 4
		}
	}
}

#Anti Demon Rioters Fought
character_event = {
	id = WCRAC.1111
	hide_window = no
	title = EVTTITLE_WCRAC_1111
	desc = EVTDESC_WCRAC_1111
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Nathrezim_Fighting_Mob
	
	is_triggered_only = yes

	trigger = {
		trait = creature_lothraxim
		is_female = no
		has_character_flag = fought_antidemon_rioters_flag
		is_landed = yes
		primary_title = {
    				higher_tier_than = count
		}			
	}
		
		immediate = {
			clr_character_flag = fought_antidemon_rioters_flag
		}

	option = {
		
		name = EVTOPTA_WCRAC_1111
		prestige = 100

	}
}

#Anti Demon Rioters Fled
character_event = {
	id = WCRAC.1112
	hide_window = no
	title = EVTTITLE_WCRAC_1112
	desc = EVTDESC_WCRAC_1112
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Nathrezim_Flying
	
	is_triggered_only = yes

	trigger = {
		trait = creature_lothraxim
		is_female = no
		has_character_flag = fled_antidemon_rioters_flag
		is_landed = yes
		primary_title = {
    				higher_tier_than = count
		}			
	}

		immediate = {
			clr_character_flag = fled_antidemon_rioters_flag
		}

	option = {
		
		name = EVTOPTA_WCRAC_1112
	}
}

#Anti Demon Rioters Pacified
character_event = {
	id = WCRAC.1113
	hide_window = no
	title = EVTTITLE_WCRAC_1113
	desc = EVTDESC_WCRAC_1113
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Antidemon_Riot
	
	is_triggered_only = yes

	trigger = {
		trait = creature_lothraxim
		is_female = no
		has_character_flag = pacified_antidemon_rioters_flag
		is_landed = yes
		primary_title = {
    				higher_tier_than = count
		}			
	}
		
		immediate = {
			clr_character_flag = pacified_antidemon_rioters_flag
		}

	option = {
		
		name = EVTOPTA_WCRAC_1113
		prestige = 100

	}
}
	
# Revolt Set Off
character_event = {
	id = WCRAC.1114
	title = EVTTITLE_WCRAC_1114
	desc = EVTDESC_WCRAC_1114
	picture = { 
		trigger = {
			owner = { 
				NOT = { is_female = yes }
			} 
		}
		picture = GFX_evt_Nathrezim_Fighting_Mob
	}
	picture = { 
		trigger = { 
			owner = {
				is_female = yes
			}
		} 
		picture = GFX_evt_Sayaad_Fighting_Mob
	}
	border = GFX_event_normal_frame_war
	
	mean_time_to_happen = { 
		days = 1
		}

	trigger = { 
		has_character_flag = antidemon_rioters_flag
		trait = creature_lothraxim
		primary_title = {
    			higher_tier_than = count
		}
	}

	immediate = {
		random_demesne_province = {
			set_province_flag = force_peasant_revolt
			province_event = { id = WCRAC.1115 }
			clr_province_flag = force_peasant_revolt
		}

		clr_character_flag = antidemon_rioters_flag
	}
	option = {
		name = "EVTOPTA_WCRAC_1114"
	}
}

# Revolt against Lothraxim ruler (temporary rebel title created, with a leader and a war)
# Triggered from "on_rebel_revolt"
province_event = {
	id = WCRAC.1115
	hide_window = yes
	is_triggered_only = yes

	trigger = {
		OR = {
			has_dlc = "The Old Gods"
			has_province_flag = force_peasant_revolt
		}
		
		# Will get clan rebels instead
		NAND = {
			has_empty_holding = yes
			owner = {
				is_nomadic = yes
			}
		}
		
		any_province_holding = {
			NOT = { holding_type = nomad }
		}
		
		# Heretic revolts have prio
		OR = {
			is_heretic = no
			owner = {
				top_liege = {
					NOT = { is_parent_religion = ROOT }
				}
			}
			has_province_flag = force_peasant_revolt
		}
		
		# Religious revolts have prio
		OR = {
			owner = {
				top_liege = {
					religion_group = ROOT
				}
			}
			has_province_flag = force_peasant_revolt
		}
		
		# Nationalist revolts have prio
		OR = {
			owner = {
				top_liege = {
					culture = ROOT
				}
			}
			kingdom = {
				OR = {
					has_holder = yes
					NOT = { culture = ROOT }
					NOT = { 
						# The de jure kingdom must have had an appropriate holder in the past
						any_previous_holder = {
							ROOT = {
								owner = {
									top_liege = {
										NOT = { dynasty = PREVPREVPREV }
										OR = {
											is_nomadic = no
											NOT = { culture_group = ROOT }
										}
									}
								}
							}
						}
					} 
				}
			}
			has_province_flag = force_peasant_revolt
		}
		
		OR = {
			has_province_flag = force_peasant_revolt
			NOT = { # Not if there is already an ongoing peasant revolt for this province
				owner = {
					top_liege = {
						war = yes
						
						any_war = {
							defender = { character = PREV }
							OR = {
								AND = {
									using_cb = peasant_revolt
									war_title = ROOT # The county
								}
								AND = {
									using_cb = heretic_revolt
									attacker = { religion = ROOT }
								}
								AND = {
									using_cb = religious_revolt
									attacker = { religion = ROOT }
								}
								AND = {
									using_cb = liberation_revolt
									thirdparty_title_scope = {
										ROOT = {
											kingdom = {
												title = PREVPREV
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	
	immediate = {
		remove_province_modifier = rumors_of_witchcraft

		#Clean-up leaders who are unfit to lead Holy Orders
		abdicate_holy_order_if_religion_changes_effect = yes
	
	
		create_character = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 25
			attributes = {
				martial = 5
			}
			trait = peasant_leader
			trait = tough_soldier
		}
		
		new_character = {
			create_title = {
				tier = DUKE
				landless = yes
				temporary = yes
				rebel = yes
				culture = ROOT
				name = "PEASANT_REVOLT"
				holder = THIS
			}
			
			wealth = 100
			
			spawn_peasant_army_effect = yes
			
			if = {
				limit = {
					has_game_rule = {
						name = provincial_revolt_strength
						value = powerful
					}
				}
				spawn_peasant_army_effect = yes
				wealth = 150
			}
			
			if = {
				limit = {
					has_game_rule = {
						name = provincial_revolt_strength
						value = very_powerful
					}
				}
				spawn_peasant_army_effect = yes
				spawn_peasant_army_effect = yes
				spawn_peasant_army_effect = yes
				wealth = 250
			}
			
			if = {
				limit = {
					has_game_rule = {
						name = provincial_revolt_strength
						value = extremely_powerful
					}
				}
				spawn_peasant_army_effect = yes
				spawn_peasant_army_effect = yes
				spawn_peasant_army_effect = yes
				spawn_peasant_army_effect = yes
				spawn_peasant_army_effect = yes
				wealth = 350
			}
			
			# DoW on the province top liege
			ROOT = {
				owner = {
					top_liege = {
#						set_defacto_vassal = PREVPREVPREV
						reverse_war = {
							target = PREVPREVPREV
							casus_belli = peasant_revolt
							thirdparty_title = ROOT # The county
						}
						reverse_opinion = {
							who = PREVPREVPREV
							modifier = opinion_evil_tyrant
						}
					}
				}
			}
		}
		
		owner = {
			any_liege = { # Inform the lieges
				character_event = {
					id = TOG.1001
				}
			}
		}
	}

	option = {
		name = "EVTOPTA_TOG_1000"
	}
}

#Anti Demoness Riot
character_event = {
	id = WCRAC.1116
	hide_window = no
	title = EVTTITLE_WCRAC_1116
	desc = EVTDESC_WCRAC_1116
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Antidemoness_Riot
	
	trigger = {
		has_game_rule = {
				name = lothraxim_rebellions
				value = on
		}
		trait = creature_lothraxim
		is_adult = yes
		is_female = yes
		NOT = { has_character_flag = antidemon_rioters_flag }
		is_landed = yes
		primary_title = {
    				higher_tier_than = count
		}			
	}

	mean_time_to_happen = { 
		years = 10 
		modifier = {
			factor = 1.5
			indepenedent = no
		}
		modifier = {
			factor = .5
			trait = cruel
		}
		modifier = {
			factor = .5
			trait = arbitrary
		}
		modifier = {
			factor = 1.5
			trait = just
		}
		modifier = {
			factor = 1.5
			any_owned_bloodline = { 
				has_bloodline_flag = lothraxim_redeemer_bloodline_flag
			}
		}
		modifier = {
			factor = 1.5
			any_owned_bloodline = { 
				AND = {
					has_bloodline_flag = end_of_legion_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
			}
		}
		modifier = {
			factor = 1.5
			any_owned_bloodline = { 
				AND = {
					has_bloodline_flag = end_of_scourge_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
			}
		}
		modifier = {
			factor = 1.5
			any_owned_bloodline = { 
				AND = {
					has_bloodline_flag = end_of_black_empire_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
			}
		}
	}
		
		
		immediate = {
			set_character_flag = antidemon_rioters_flag
		}

	#Fight	
	
	option = {
		
		name = EVTOPTA_WCRAC_1116
		tooltip_info_custom = EVTOPTA_WCRAC_1110_Tooltip
		

		random = {
			chance = 20
			add_trait = brave
		}
		
		if = {
   			limit = {
				combat_rating >= 50
			}
			random_list = {
				80 = {
					prestige = 50
					set_character_flag = fought_antidemon_rioters_flag
					clr_character_flag = antidemon_rioters_flag
					character_event = { id = WCRAC.1117 days = 2} 
				}
				10 = {
					add_character_modifier = {
					name = badly_bruised
					months = 60
					}
				}

				10 = {
					add_character_modifier = {
					name = beaten_up
					months = 60
					}
				
				}
			}
		}				
		
		else_if = {
   			limit = {
				combat_rating >= 0
			}
			random_list = {
				40 = {
					prestige = 50
					set_character_flag = fought_antidemon_rioters_flag
					clr_character_flag = antidemon_rioters_flag
					character_event = { id = WCRAC.1117 days = 2} 
				}
				30 = {
					add_character_modifier = {
					name = badly_bruised
					months = 60
					}
				}

				30 = {
					add_character_modifier = {
					name = beaten_up
					months = 60
					}
				}
			}				 
		}
		else = {
   			limit = {
				combat_rating <= 0
			}
			random_list = {
				20 = {
					set_character_flag = fought_antidemon_rioters_flag
					clr_character_flag = antidemon_rioters_flag
					character_event = { id = WCRAC.1117 days = 2} 
				}
				40 = {
					add_character_modifier = {
					name = badly_bruised
					months = 60
					}
				}

				40 = {
					add_character_modifier = {
					name = beaten_up
					months = 60
					}
				}
			}				 
		}
		ai_chance = {
			factor = 1
			modifier = {
				factor = 2
				trait = wroth
			}
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 2
				combat_rating >= 50
			}
		}
	}		

	#Flight

	option = {
		
		name = EVTOPTB_WCRAC_1116
		tooltip_info_custom = EVTOPTB_WCRAC_1116_Tooltip

		if = {
			limit = {
				intrigue > 25
			}
			random = {
				chance = 80
				set_character_flag = fled_antidemon_rioters_flag
				clr_character_flag = antidemon_rioters_flag
				character_event = { id = WCRAC.1118 days = 2} 
			}
		}
		else_if = {
			limit = {
				intrigue > 10
			}
			random = {
				chance = 40
				set_character_flag = fled_antidemon_rioters_flag
				clr_character_flag = antidemon_rioters_flag
				character_event = { id = WCRAC.1118 days = 2} 
			}
		}
		else = {
			random = {
				chance = 20
				set_character_flag = fled_antidemon_rioters_flag
				clr_character_flag = antidemon_rioters_flag
				character_event = { id = WCRAC.1118 days = 2} 
			}
		}
		ai_chance = {
			factor = 2
			modifier = {
				factor = 2
				intrigue >= 25
			}
		}	
	}

	#Friend

	option = {
		
		name = EVTOPTC_WCRAC_1116
		tooltip_info_custom = EVTOPTC_WCRAC_1116_Tooltip

		if = {
			limit = {
				OR = { 
					any_owned_bloodline = { 
						has_bloodline_flag = lothraxim_redeemer_bloodline_flag
					}
					
					any_owned_bloodline = { 
						AND = {
							has_bloodline_flag = end_of_scourge_bloodline_flag
							founder = {
								trait = creature_lothraxim
							}
						}
					}
					any_owned_bloodline = { 
						AND = {
							has_bloodline_flag = end_of_legion_bloodline_flag
							founder = {
								trait = creature_lothraxim
							}
						}
					}				
					any_owned_bloodline = { 
						AND = {
							has_bloodline_flag =end_of_black_empire_bloodline_flag
							founder = {
								trait = creature_lothraxim
							}
						}
					}
				}
			}
			random = {
				chance = 95
				set_character_flag = pacified_antidemon_rioters_flag
				clr_character_flag = antidemon_rioters_flag
				character_event = { id = WCRAC.1170 days = 2}  
			}
		}
		else_if = {
			limit = {
				OR = {
					trait = gregarious
					diplomacy >= 25
				}
			}
			random = {
				chance = 80
				set_character_flag = pacified_antidemon_rioters_flag
				clr_character_flag = antidemon_rioters_flag
				character_event = { id = WCRAC.1119 days = 2}  
			}
		}
		else_if = {
			limit = {
				diplomacy >= 10
			}
			random = {
				chance = 40
				set_character_flag = pacified_antidemon_rioters_flag
				clr_character_flag = antidemon_rioters_flag
				character_event = { id = WCRAC.1119 days = 2}  
			}
		}
		else = {
			random = {
				chance = 20
				set_character_flag = pacified_antidemon_rioters_flag
				clr_character_flag = antidemon_rioters_flag
				character_event = { id = WCRAC.1119 days = 2} 
			}
		}
		ai_chance = {
			factor = 1
			modifier = {
				factor = 2
				trait = gregarious
			}
			modifier = {
				factor = 2
				diplomacy >= 25
			}
		}	
	}

	#Flirt

	option = {
		
		name = EVTOPTD_WCRAC_1116
		
		trigger = {
			OR = {
				trait = fair
				trait = seductress
			}
		}
		
		tooltip_info = seductress
		
		random = {
			chance = 80
			set_character_flag = pacified_antidemon_rioters_flag
			clr_character_flag = antidemon_rioters_flag
			character_event = { id = WCRAC.1119 days = 2} 
		}
		ai_chance = {
			factor = 2
			modifier = {
				factor = 2
				trait = lustful
			}
		}	
	}
}

#Anti Demoness Rioters Fought
character_event = {
	id = WCRAC.1117
	hide_window = no
	title = EVTTITLE_WCRAC_1117
	desc = EVTDESC_WCRAC_1117
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Sayaad_Fighting_Mob
	
	is_triggered_only = yes

	trigger = {
		trait = creature_lothraxim
		is_female = yes
		has_character_flag = fought_antidemon_rioters_flag
		is_landed = yes
		primary_title = {
    				higher_tier_than = count
		}			
	}

		immediate = {
			clr_character_flag = fought_antidemon_rioters_flag
		}

	option = {
		
		name = EVTOPTA_WCRAC_1117
		prestige = 50

	}
}

#Anti Demoness Rioters Fled
character_event = {
	id = WCRAC.1118
	hide_window = no
	title = EVTTITLE_WCRAC_1118
	desc = EVTDESC_WCRAC_1118
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Sayaad_Fleeing_Mob
	
	is_triggered_only = yes

	trigger = {
		trait = creature_lothraxim
		is_female = yes
		has_character_flag = fled_antidemon_rioters_flag
		is_landed = yes
		primary_title = {
    				higher_tier_than = count
		}			
	}
		
		immediate = {
			clr_character_flag = fled_antidemon_rioters_flag
		}

	option = {
		
		name = EVTOPTA_WCRAC_1118
	}
}

#Anti Demoness Rioters Pacified
character_event = {
	id = WCRAC.1119
	hide_window = no
	title = EVTTITLE_WCRAC_1119
	desc = EVTDESC_WCRAC_1119
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Sayaad_Seducing_Mob
	
	is_triggered_only = yes

	trigger = {
		trait = creature_lothraxim
		is_female = yes
		has_character_flag = pacified_antidemon_rioters_flag
		is_landed = yes
		primary_title = {
    				higher_tier_than = count
		}			
	}

		immediate = {
			clr_character_flag = pacified_antidemon_rioters_flag
		}

	option = {
		
		name = EVTOPTA_WCRAC_1119
		prestige = 50

	}
	option = {
		
		name = EVTOPTB_WCRAC_1119
		add_trait = lustful
	}
}

# Lothraxim female and spouse
character_event = {
	id = WCRAC.1120
	
	hide_window = no
	title = EVTTITLE_WCRAC_1120
	desc = EVTDESC_WCRAC_1120
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Lothraxim_Married_Couple
	
	trigger = {
		has_game_rule = {
				name = lothraxim_family
				value = on
		}
		trait = creature_lothraxim
		is_female = yes
		is_married = yes
		has_lover = no
		NOT = { has_character_flag = marital_affection_flag }
		
		any_spouse = {
			is_alive = yes
			ai = yes
			NOT = { is_lover = ROOT }
			NOT = { is_rival = ROOT }
			NOT = { is_incapable = yes }
			prisoner = no
		}
	}
	
	mean_time_to_happen = { 
		years = 10 
		modifier = {
			factor = 0.8
			has_character_modifier = wol_seducer_1
		}
		modifier = {
			factor = 0.4
			has_character_modifier = wol_seducer_2
		}
		modifier = {
			factor = 0.2
			OR = {
				trait = seducer
				trait = seductress
			}
		}
		modifier = {
			factor = 2.0
			trait = cruel
		}
		modifier = {
			factor = 0.66
			trait = kind
		}
		modifier = {
			factor = 0.66
			trait = groomed
		}
		modifier = {
			factor = 0.66
			has_fair_trait_trigger = yes
		}
	}
	
	immediate = {
		set_character_flag = marital_affection_flag

		random_spouse = {
			limit = {
				is_alive = yes
				ai = yes
				NOT = { is_lover = ROOT }
				NOT = { is_rival = ROOT }
				NOT = { is_incapable = yes }
				prisoner = no
			}
			save_event_target_as = target_spouse
		}
	}
	
	option = {
		name = EVTOPTA_WCRAC_1120

		trigger = {
			ROOT = {
				personal_opinion = {
					who = event_target:target_spouse
					value <= 0
				}
			}	
		}
		
		event_target:target_spouse = {
			opinion = {
				who = ROOT
				modifier = opinion_marital_love
			}
		}

		opinion = {
			who = event_target:target_spouse
			modifier = opinion_marital_love
		}

		ai_chance = {
			factor = 1
		}
	}

	option = {
		name = EVTOPTB_WCRAC_1120

		trigger = {
			ROOT = {
				personal_opinion = {
					who = event_target:target_spouse
					value >= 0
				}
				NOT = { is_friend = event_target:target_spouse }
			}
		}
				
		add_friend = event_target:target_spouse

		ai_chance = {
			factor = 1
			modifier = {
				factor = 2
				trait = kind
			}
		}
	}

	option = {
		name = EVTOPTC_WCRAC_1120

		trigger = {
			ROOT = {
				personal_opinion = {
					who = event_target:target_spouse
					value >= 0
				}
			}
		}
				
		add_lover = event_target:target_spouse

		ai_chance = {
			factor = 2
			modifier = {
				factor = 2
				trait = lustful
			}
		}
	}

	option = {
		name = EVTOPTD_WCRAC_1120

		ai_chance = {
			factor = .5
			modifier = {
				factor = 2
				trait = shy
			}
		}
	}
}

# Clears marital_affection_flag
character_event = {
	id = WCRAC.1121
	
	hide_window = yes
	
	trigger = {
		had_character_flag = {
    			flag = marital_affection_flag
   			years >= 2
		}
	}
	mean_time_to_happen = {
	days = 1
	}
	
	immediate = {

		clr_character_flag = marital_affection_flag
	}
}

# Lothraxim player male and spouse
character_event = {
	id = WCRAC.1122
	
	hide_window = no
	title = EVTTITLE_WCRAC_1122
	desc = EVTDESC_WCRAC_1122
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Lothraxim_Married_Couple
	
	trigger = {
		has_game_rule = {
				name = lothraxim_family
				value = on
		}
		trait = creature_lothraxim
		ai = no
		is_female = no
		is_married = yes
		NOT = { has_character_flag = marital_affection_flag }
		
		any_spouse = {
			is_alive = yes
			ai = yes
			trait = creature_lothraxim
			has_lover = no
			NOT = { is_lover = ROOT }
			NOT = { is_rival = ROOT }
			NOT = { is_incapable = yes }
			prisoner = no
			opinion = {
				who = ROOT
				value >= 20
			}
		}
	}
	
	mean_time_to_happen = { 
		years = 10 
		modifier = {
			factor = 0.8
			has_character_modifier = wol_seducer_1
		}
		modifier = {
			factor = 0.4
			has_character_modifier = wol_seducer_2
		}
		modifier = {
			factor = 0.2
			OR = {
				trait = seducer
				trait = seductress
			}
		}
		modifier = {
			factor = 2.0
			trait = cruel
		}
		modifier = {
			factor = 0.66
			trait = kind
		}
		modifier = {
			factor = 0.66
			trait = groomed
		}
		modifier = {
			factor = 0.66
			has_fair_trait_trigger = yes
		}
	}
	
	immediate = {
		set_character_flag = marital_affection_flag

		random_spouse = {
			limit = {
				is_alive = yes
				ai = yes
				trait = creature_lothraxim
				has_lover = no
				NOT = { is_lover = ROOT }
				NOT = { is_rival = ROOT }
				NOT = { is_incapable = yes }
				prisoner = no
				opinion = {
					who = ROOT
					value >= 20
				}
			}
			save_event_target_as = target_spouse
		}
	}
	
	option = {
		name = EVTOPTA_WCRAC_1122

		trigger = {
			ROOT = {
				personal_opinion = {
					who = event_target:target_spouse
					value >= 0
				}
				NOT = { is_friend = event_target:target_spouse }
			}
		}
				
		add_friend = event_target:target_spouse

		random = {
			chance = 20
			add_trait = chaste
		}	

		ai_chance = {
			factor = 1
		}
	}

	option = {
		name = EVTOPTB_WCRAC_1122

		trigger = {
			ROOT = {
				personal_opinion = {
					who = event_target:target_spouse
					value >= 0
				}
			}
		}
				
		add_lover = event_target:target_spouse

		random = {
			chance = 50
			add_trait = lustful
		}	

		random = {
			chance = 5
			add_trait = erudite
		}	

		ai_chance = {
			factor = 2
			modifier = {
				factor = 2
				trait = lustful
			}
		}
	}

	option = {
		name = EVTOPTC_WCRAC_1122
		
		event_target:target_spouse = {
			opinion = {
				who = ROOT
				modifier = opinion_declined_romance
				months = 24
			}

			random = {
				chance = 20
				add_trait = wroth
			}	
		}

		random = {
			chance = 20
			add_trait = erudite
		}	

		ai_chance = {
			factor = .5
			modifier = {
				factor = 2
				trait = chaste
			}
		}
	}		
}

# Choose Lothraxim Redeemer or Ended Legion Bloodline
character_event = {
	id = WCRAC.1125
	hide_window = no
	title = EVTTITLE_WCRAC_1125
	desc = EVTDESC_WCRAC_1125
	border = GFX_event_normal_frame_war
	picture = GFX_evt_Lothraxion_Fighting
	
	is_triggered_only = yes

	
	option = {
		name = EVTOPTA_WCRAC_1125

		trigger = {
			religion_group = light_group
			NOR = { 
				has_character_flag = lothraxim_redeemer_flag
				any_owned_bloodline = { has_bloodline_flag = lothraxim_redeemer_bloodline_flag } 
			}
		}
		
		create_bloodline = {
			type = Lothraxim_Redeemer
		}

		give_nickname = nick_the_redeemed

		add_trait = zealous

		set_character_flag = lothraxim_redeemer_flag 
	}
	option = {
		name = EVTOPTB_WCRAC_1125
		
		trigger = {
			is_female = no
			NOT = { 
				any_owned_bloodline = { has_bloodline_flag = end_of_legion_bloodline_flag } 
			}	
		}
		
		create_bloodline = {
			type = end_of_legion
			inheritance = all_descendants
		}

		add_trait = diligent
		
	}
	option = {
		name = EVTOPTC_WCRAC_1125
		
		trigger = {
			is_female = yes	
			NOT = { 
				any_owned_bloodline = { has_bloodline_flag = end_of_legion_bloodline_flag } 
			}	
		}

		create_bloodline = {
			type = end_of_legion
			inheritance = all_descendants
		}
		
		add_trait = diligent
	}
}

# Lothraxim Bloodline Descendants Male
character_event = {
	has_game_rule = {
				name = lothraxim_bloodline
				value = on
	}
	id = WCRAC.1126
	hide_window = no
	title = EVTTITLE_WCRAC_1126
	desc = EVTDESC_WCRAC_1126
	border = GFX_event_normal_frame_diplomacy
	picture = GFX_evt_Nathrezim_Confident_Ruler
	
	trigger = {
		trait = creature_lothraxim
		is_adult = yes
		is_female = no
		primary_title = {
    			higher_tier_than = count
		}
		any_owned_bloodline = { 
			OR = {
				has_bloodline_flag = lothraxim_redeemer_bloodline_flag
				
				AND = {
					has_bloodline_flag = end_of_legion_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
				AND = {
					has_bloodline_flag = end_of_scourge_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
				AND = {
					has_bloodline_flag = end_of_black_empire_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
			}
		}
		NOT = {
			has_character_modifier = wol_respected_ruler
		}
	}	
	mean_time_to_happen = { 
		years = 35 
		modifier = {
			factor = 2
			trait = cruel
		}
		modifier = {
			factor = 1.5
			trait = arbitrary
		}
		modifier = {
			factor = .75
			trait = just
		}
		modifier = {
			factor = .75
			has_focus = focus_rulership 
		}
		modifier = {
			factor = .75
			any_owned_bloodline = { 
				has_bloodline_flag = lothraxim_redeemer_bloodline_flag
			}
		}
		modifier = {
			factor = .75
			any_owned_bloodline = { 
				AND = {
					has_bloodline_flag = end_of_legion_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
			}
		}
		modifier = {
			factor = .75
			any_owned_bloodline = { 
				AND = {
					has_bloodline_flag = end_of_scourge_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
			}
		}
		modifier = {
			factor = .75
			any_owned_bloodline = { 
				AND = {
					has_bloodline_flag = end_of_black_empire_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
			}
		}
	}
	
	option = {
		name = "EVTOPTA_WCRAC_1126"

		prestige = 100

		if = {
			limit = {
				primary_title = {
    					higher_tier_than = duke
				}
			}
			random_list = {
				80 = {
					add_artifact = sword_onehanded_4
				}
				20 = {
					add_artifact = sword_onehanded_5	
				}
			}
		}
		else = {
			random_list = {
				80 = {
					add_artifact = sword_onehanded_3
				}
				20 = {
					add_artifact = sword_onehanded_4	
				}
			}
		}
		ai_chance = {
			factor = 2
		}
	}
	
	option = {
		name = "EVTOPTD_WCRAC_1126"

		prestige = 100

		if = {
			limit = {
				primary_title = {
    					higher_tier_than = duke
				}
			}
			random_list = {
				80 = {
					add_artifact = sword_twohanded_4
				}
				20 = {
					add_artifact = sword_twohanded_5	
				}
			}
		}
		else = {
			random_list = {
				80 = {
					add_artifact = sword_twohanded_3
				}
				20 = {
					add_artifact = sword_twohanded_4	
				}
			}
		}
		ai_chance = {
			factor = 2
		}
	}
	option = {
		name = "EVTOPTB_WCRAC_1126"

		wealth = -100
		prestige = 200
		add_character_modifier = {
			name = wol_respected_ruler
			months = 60
		}
		
		random = {
			chance = 50
			add_trait = gregarious
		}
		if = {
			limit = {
				primary_title = {
    					higher_tier_than = duke
				}
			}
			random_list = {
				25 = {
					add_artifact = sword_onehanded_4
				}
				25 = {
					add_artifact = sword_onehanded_5	
				}
				25 = {
					add_artifact = sword_twohanded_4
				}
				25 = {
					add_artifact = sword_twohanded_5	
				}
			}
		}
		else = {
			random_list = {
				25 = {
					add_artifact = sword_onehanded_3
				}
				25 = {
					add_artifact = sword_onehanded_4	
				}
				25 = {
					add_artifact = sword_twohanded_3
				}
				25 = {
					add_artifact = sword_twohanded_4	
				}
			}
		}
		ai_chance = {
			factor = 1
			modifier = {
				factor = 2
				trait = gregarious
			}
		}
	}
	option = {
		name = "EVTOPTC_WCRAC_1126"

		add_trait = cruel
		
		wealth = 5

		capital_scope = {
			add_province_modifier = {
				name = peasant_unrest
				months = 60
			}
		}
		ai_chance = {
			factor = .10
			modifier = {
				factor = 2
				trait = cruel
			}
			modifier = {
				factor = 2
				trait = wroth
			}
		}
	}
}
# Lothraxim Bloodline Descendants Female
character_event = {
	id = WCRAC.1127
	hide_window = no
	title = EVTTITLE_WCRAC_1127
	desc = EVTDESC_WCRAC_1127
	border = GFX_event_normal_frame_diplomacy
	picture = GFX_evt_Sayaad_Confident_Ruler
	
	trigger = {
		has_game_rule = {
				name = lothraxim_bloodline
				value = on
		}
		trait = creature_lothraxim
		is_adult = yes
		is_female = yes
		primary_title = {
    			higher_tier_than = count
		}
		any_owned_bloodline = { 
			OR = {
				has_bloodline_flag = lothraxim_redeemer_bloodline_flag
				
				AND = {
					has_bloodline_flag = end_of_legion_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
				AND = {
					has_bloodline_flag = end_of_scourge_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
				AND = {
					has_bloodline_flag = end_of_black_empire_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
			}
		}
		NOT = {
			has_character_modifier = wol_respected_ruler
		}
	}	
	mean_time_to_happen = { 
		years = 35 
		modifier = {
			factor = 2
			trait = cruel
		}
		modifier = {
			factor = 1.5
			trait = arbitrary
		}
		modifier = {
			factor = .75
			trait = just
		}
		modifier = {
			factor = .75
			has_focus = focus_rulership 
		}
		modifier = {
			factor = .75
			any_owned_bloodline = { 
				has_bloodline_flag = lothraxim_redeemer_bloodline_flag
			}
		}
		modifier = {
			factor = .75
			any_owned_bloodline = { 
				AND = {
					has_bloodline_flag = end_of_legion_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
			}
		}
		modifier = {
			factor = .75
			any_owned_bloodline = { 
				AND = {
					has_bloodline_flag = end_of_scourge_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
			}
		}
		modifier = {
			factor = .75
			any_owned_bloodline = { 
				AND = {
					has_bloodline_flag = end_of_black_empire_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
			}
		}
	}
	
	option = {
		name = "EVTOPTA_WCRAC_1127"

		prestige = 100

		if = {
			limit = {
				primary_title = {
    					higher_tier_than = duke
				}
			}
			random_list = {
				8 = {
					add_artifact = amulet_4_diplomacy
				}
				8 = {
					add_artifact = amulet_4_intrigue
				}
				8 = {
					add_artifact = amulet_4_stewardship
				}
				8 = {
					add_artifact = amulet_4_martial
				}
				8 = {
					add_artifact = amulet_4_learning
				}
				2 = {
					add_artifact = amulet_5_diplomacy
				}
				2 = {
					add_artifact = amulet_5_intrigue
				}
				2 = {
					add_artifact = amulet_5_stewardship
				}
				2 = {
					add_artifact = amulet_5_martial
				}
				2 = {
					add_artifact = amulet_5_learning
				}
				8 = {
					add_artifact = ring_4_diplomacy
				}
				8 = {
					add_artifact = ring_4_intrigue
				}
				8 = {
					add_artifact = ring_4_stewardship
				}
				8 = {
					add_artifact = ring_4_martial
				}
				8 = {
					add_artifact = ring_4_learning
				}
				2 = {
					add_artifact = ring_5_diplomacy
				}
				2 = {
					add_artifact = ring_5_intrigue
				}	
				2 = {
					add_artifact = ring_5_stewardship
				}
				2 = {
					add_artifact = ring_5_martial
				}
				2 = {
					add_artifact = ring_5_learning
				}
			}
		}
		else = {
			random_list = {
				8 = {
					add_artifact = amulet_3_diplomacy
				}
				8 = {
					add_artifact = amulet_3_intrigue
				}
				8 = {
					add_artifact = amulet_3_stewardship
				}
				8 = {
					add_artifact = amulet_3_martial
				}
				8 = {
					add_artifact = amulet_3_learning
				}
				2 = {
					add_artifact = amulet_4_diplomacy
				}
				2 = {
					add_artifact = amulet_4_intrigue
				}
				2 = {
					add_artifact = amulet_4_stewardship
				}
				2 = {
					add_artifact = amulet_4_martial
				}
				2 = {
					add_artifact = amulet_4_learning
				}
				8 = {
					add_artifact = ring_3_diplomacy
				}
				8 = {
					add_artifact = ring_3_intrigue
				}
				8 = {
					add_artifact = ring_3_stewardship
				}
				8 = {
					add_artifact = ring_3_martial
				}
				8 = {
					add_artifact = ring_3_learning
				}
				2 = {
					add_artifact = ring_4_diplomacy
				}
				2 = {
					add_artifact = ring_4_intrigue
				}
				2 = {
					add_artifact = ring_4_stewardship
				}
				2 = {
					add_artifact = ring_4_martial
				}
				2 = {
					add_artifact = ring_4_learning
				}
			
			}
		}
		
		ai_chance = {
			factor = 2
		}
	}

	option = {
		name = "EVTOPTB_WCRAC_1127"

		wealth = -100
		prestige = 200
		add_character_modifier = {
			name = wol_respected_ruler
			months = 60
		}
		
		random = {
			chance = 50
			add_trait = gregarious
		}
		
		if = {
			limit = {
				primary_title = {
    					higher_tier_than = duke
				}
			}
			random_list = {
				8 = {
					add_artifact = amulet_4_diplomacy
				}
				8 = {
					add_artifact = amulet_4_intrigue
				}
				8 = {
					add_artifact = amulet_4_stewardship
				}
				8 = {
					add_artifact = amulet_4_martial
				}
				8 = {
					add_artifact = amulet_4_learning
				}
				2 = {
					add_artifact = amulet_5_diplomacy
				}
				2 = {
					add_artifact = amulet_5_intrigue
				}
				2 = {
					add_artifact = amulet_5_stewardship
				}
				2 = {
					add_artifact = amulet_5_martial
				}
				2 = {
					add_artifact = amulet_5_learning
				}
				8 = {
					add_artifact = ring_4_diplomacy
				}
				8 = {
					add_artifact = ring_4_intrigue
				}
				8 = {
					add_artifact = ring_4_stewardship
				}
				8 = {
					add_artifact = ring_4_martial
				}
				8 = {
					add_artifact = ring_4_learning
				}
				2 = {
					add_artifact = ring_5_diplomacy
				}
				2 = {
					add_artifact = ring_5_intrigue
				}	
				2 = {
					add_artifact = ring_5_stewardship
				}
				2 = {
					add_artifact = ring_5_martial
				}
				2 = {
					add_artifact = ring_5_learning
				}
			}
		}
		else = {
			random_list = {
				8 = {
					add_artifact = amulet_3_diplomacy
				}
				8 = {
					add_artifact = amulet_3_intrigue
				}
				8 = {
					add_artifact = amulet_3_stewardship
				}
				8 = {
					add_artifact = amulet_3_martial
				}
				8 = {
					add_artifact = amulet_3_learning
				}
				2 = {
					add_artifact = amulet_4_diplomacy
				}
				2 = {
					add_artifact = amulet_4_intrigue
				}
				2 = {
					add_artifact = amulet_4_stewardship
				}
				2 = {
					add_artifact = amulet_4_martial
				}
				2 = {
					add_artifact = amulet_4_learning
				}
				8 = {
					add_artifact = ring_3_diplomacy
				}
				8 = {
					add_artifact = ring_3_intrigue
				}
				8 = {
					add_artifact = ring_3_stewardship
				}
				8 = {
					add_artifact = ring_3_martial
				}
				8 = {
					add_artifact = ring_3_learning
				}
				2 = {
					add_artifact = ring_4_diplomacy
				}
				2 = {
					add_artifact = ring_4_intrigue
				}
				2 = {
					add_artifact = ring_4_stewardship
				}
				2 = {
					add_artifact = ring_4_martial
				}
				2 = {
					add_artifact = ring_4_learning
				}
			}
		}
		ai_chance = {
			factor = .5
			modifier = {
				factor = 2
				trait = gregarious
			}
		}
	}
	option = {
		name = "EVTOPTC_WCRAC_1127"

		add_trait = cruel
		
		capital_scope = {
			add_province_modifier = {
				name = peasant_unrest
				months = 60
			}
		}
		ai_chance = {
			factor = .10
			modifier = {
				factor = 2
				trait = cruel
			}
			modifier = {
				factor = 2
				trait = wroth
			}
		}
	}
	option = {
		name = "EVTOPTD_WCRAC_1127"

		prestige = 100

		add_trait = kind
	
		random = {
			chance = 50
			add_trait = proud
		}	
		random = {
			chance = 10
			add_trait = groomed
		}	

		if = {
			limit = {
				primary_title = {
    					higher_tier_than = duke
				}
			}
			random_list = {
				8 = {
					add_artifact = amulet_4_diplomacy
				}
				8 = {
					add_artifact = amulet_4_intrigue
				}
				8 = {
					add_artifact = amulet_4_stewardship
				}
				8 = {
					add_artifact = amulet_4_martial
				}
				8 = {
					add_artifact = amulet_4_learning
				}
				2 = {
					add_artifact = amulet_5_diplomacy
				}
				2 = {
					add_artifact = amulet_5_intrigue
				}
				2 = {
					add_artifact = amulet_5_stewardship
				}
				2 = {
					add_artifact = amulet_5_martial
				}
				2 = {
					add_artifact = amulet_5_learning
				}
				8 = {
					add_artifact = ring_4_diplomacy
				}
				8 = {
					add_artifact = ring_4_intrigue
				}
				8 = {
					add_artifact = ring_4_stewardship
				}
				8 = {
					add_artifact = ring_4_martial
				}
				8 = {
					add_artifact = ring_4_learning
				}
				2 = {
					add_artifact = ring_5_diplomacy
				}
				2 = {
					add_artifact = ring_5_intrigue
				}	
				2 = {
					add_artifact = ring_5_stewardship
				}
				2 = {
					add_artifact = ring_5_martial
				}
				2 = {
					add_artifact = ring_5_learning
				}
			}
		}
		else = {
			random_list = {
				8 = {
					add_artifact = amulet_3_diplomacy
				}
				8 = {
					add_artifact = amulet_3_intrigue
				}
				8 = {
					add_artifact = amulet_3_stewardship
				}
				8 = {
					add_artifact = amulet_3_martial
				}
				8 = {
					add_artifact = amulet_3_learning
				}
				2 = {
					add_artifact = amulet_4_diplomacy
				}
				2 = {
					add_artifact = amulet_4_intrigue
				}
				2 = {
					add_artifact = amulet_4_stewardship
				}
				2 = {
					add_artifact = amulet_4_martial
				}
				2 = {
					add_artifact = amulet_4_learning
				}
				8 = {
					add_artifact = ring_3_diplomacy
				}
				8 = {
					add_artifact = ring_3_intrigue
				}
				8 = {
					add_artifact = ring_3_stewardship
				}
				8 = {
					add_artifact = ring_3_martial
				}
				8 = {
					add_artifact = ring_3_learning
				}
				2 = {
					add_artifact = ring_4_diplomacy
				}
				2 = {
					add_artifact = ring_4_intrigue
				}
				2 = {
					add_artifact = ring_4_stewardship
				}
				2 = {
					add_artifact = ring_4_martial
				}
				2 = {
					add_artifact = ring_4_learning
				}
			
			}
		}
		ai_chance = {
			factor = .5
			modifier = {
				factor = 2
				trait = proud
			}
			modifier = {
				factor = 2
				trait = kind
			}
		}
	}
}

#Lothraxim Duel Nature Stress
character_event = {
	id = WCRAC.1128
	hide_window = no
	title = EVTTITLE_WCRAC_1128
	desc = EVTDESC_WCRAC_1128
	border = GFX_event_normal_frame_intrigue
	picture = { 
		trigger = { 
			is_female = no
		}
		picture = GFX_evt_Lothraxim_Inner_Struggle
	}
	picture = { 
		trigger = { 
			is_female = yes
		} 
		picture = GFX_evt_Lothraxim_Inner_Struggle_Female
	}
	
	trigger = {
		has_game_rule = {
				name = lothraxim_stress
				value = on
		}
		trait = creature_lothraxim
		is_adult = yes
		NOR = {
			has_character_modifier = taking_it_easy
			has_character_modifier = new_insights
		}	
	}
	
	mean_time_to_happen = { 
		years = 10 
		modifier = {
			factor = 2
			trait = content
		}
		modifier = {
			factor = .5
			trait = stressed
		}
		modifier = {
			factor = .25
			has_character_modifier = sleep_deprivation
		}
		modifier = {
			factor = .5
			has_character_modifier = frightening_visions
		}
		modifier = {
			factor = .5
			trait = depressed
		}
		modifier = {
			factor = .75
			is_landed = yes
		}

	}
		
	option = {
		name= {
 			text = EVTOPTA_WCRAC_1128
 		
			trigger = {
				NOT = {
    					has_character_modifier = sleep_deprivation
  				}
			}	
		}

		name = {
  			text = EVTOPTB_WCRAC_1128
 	 		
			trigger = {
    				has_character_modifier = sleep_deprivation
  			}
		}

		if = {
   			limit = {
				NOT = {
					has_character_modifier = sleep_deprivation
  				}
			}
			random = {
				chance = 60
				add_character_modifier = {
					name = sleep_deprivation
					months = 60
				}				
			}
		}				
		else_if = {
   			limit = {
				has_character_modifier = sleep_deprivation
				NOT = {
    					trait = stressed
  				}
			}
			random = {
				chance = 60
				add_trait = stressed
			}
		}
		else_if = {
			limit = {
				AND = {
					has_character_modifier = sleep_deprivation
					trait = stressed
				}
				NOT = {
					trait = depressed
				}
			}
			random = {
				chance = 60
				add_trait = depressed
			}
		}
		else = {
			limit = {
				AND = {
					has_character_modifier = sleep_deprivation
					trait = stressed
					trait = depressed
				}
			}
			random = {
				chance = 60
				add_character_modifier = {
					name = frightening_visions
					months = 60
				}											
			}
		}
	}

	option = {
		name= {
 			text = EVTOPTE_WCRAC_1128
 		
			trigger = {
				NOT = { 
					secret_religion = burning_legion_religion
				}
			}	
		}
		name = {
  			text = EVTOPTF_WCRAC_1128
 	 		
			trigger = {
    				secret_religion = burning_legion_religion
  			}
		}

		trigger = {
			OR = {
				AND = {
					NOT = { trait = zealous }
					ai = no
				}	
				trait = cynical
				has_character_modifier = frightening_visions
				secret_religion = burning_legion_religion
			}
		}
		set_secret_religion = burning_legion_religion
		remove_character_modifier = frightening_visions

		ai_chance = {
			factor = .25
			modifier = {
				factor = 4
				has_character_modifier = frightening_visions
			}
			modifier = {
				factor = 10
				secret_religion = burning_legion_religion
			}
		}
	}
	
	option = {
		name = EVTOPTC_WCRAC_1128
		
		scaled_wealth = {
    			value = -0.25
   			min = -10
   			max = -100
		}
		
		add_character_modifier = {
			name = taking_it_easy
			months = 48
		}
		
		remove_character_modifier = sleep_deprivation
		
		ai_chance = {
			factor = 2
			modifier = {
				factor = .5
				trait = proud
			}
		}
	}
	
	option = {
		name = {
			text = EVTOPTD_WCRAC_1128
 	 		
			trigger = {
				OR = {	
					age >= 100
				
					any_owned_bloodline = { has_bloodline_flag = lothraxim_redeemer_bloodline_flag }
				
						
					any_owned_bloodline = { 
						AND = { 
							has_bloodline_flag = end_of_legion_bloodline_flag
							founder = {
								trait = creature_lothraxim
							}		
						}
					}
					any_owned_bloodline = { 
						AND = { 
							has_bloodline_flag = end_of_scourge_bloodline_flag
							founder = {
								trait = creature_lothraxim
							}		
						}
					}
					any_owned_bloodline = { 
						AND = { 
							has_bloodline_flag = end_of_black_empire_bloodline_flag
							founder = {
								trait = creature_lothraxim
							}		
						}
					}		
				}
			}
		}
		name = {
			text = EVTOPTG_WCRAC_1128
 	 		
			trigger = {
				AND = {
					has_secret_religion = yes
					religion_group = light_group
					NOT = { secret_religion_group = light_group }
				}
			}
		}
		
		trigger = {
			OR = {	
				AND = {
					has_secret_religion = yes
					religion_group = light_group
					NOT = { secret_religion_group = light_group }
				}

				age >= 100
				
				any_owned_bloodline = { has_bloodline_flag = lothraxim_redeemer_bloodline_flag }
				
						
				any_owned_bloodline = { 
					AND = { 
						has_bloodline_flag = end_of_legion_bloodline_flag
						founder = {
							trait = creature_lothraxim
						}		
					}
				}
				any_owned_bloodline = { 
					AND = { 
						has_bloodline_flag = end_of_scourge_bloodline_flag
						founder = {
							trait = creature_lothraxim
						}		
					}
				}
				any_owned_bloodline = { 
					AND = { 
						has_bloodline_flag = end_of_black_empire_bloodline_flag
						founder = {
							trait = creature_lothraxim
						}		
					}
				}		
			}
		}

		clear_secret_religion = yes
		remove_character_modifier = frightening_visions

		add_character_modifier = {
			name = new_insights
			months = 48
		}

		ai_chance = {
			factor = 4
			modifier = {
				factor = 2
				OR = { 
					any_owned_bloodline = { has_bloodline_flag = lothraxim_redeemer_bloodline_flag }
				
						
					any_owned_bloodline = { 
						AND = { 
							has_bloodline_flag = end_of_legion_bloodline_flag
							founder = {
								trait = creature_lothraxim
							}		
						}
					}
					any_owned_bloodline = { 
						AND = { 
							has_bloodline_flag = end_of_scourge_bloodline_flag
							founder = {
								trait = creature_lothraxim
							}		
						}
					}
					any_owned_bloodline = { 
						AND = { 
							has_bloodline_flag = end_of_black_empire_bloodline_flag
							founder = {
								trait = creature_lothraxim
							}		
						}
					}		
				}
			
			}	
		}
	}
}

# Lothraxim Family Event
character_event = {
	id = WCRAC.1129
	
	hide_window = no
	title = EVTTITLE_WCRAC_1129
	desc = EVTDESC_WCRAC_1129
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Lothraxim_Meet_the_Parents
	
	trigger = {
		has_game_rule = {
				name = lothraxim_family
				value = on
		}
		trait = creature_lothraxim
		is_adult = yes
		num_of_dynasty_members >= 10
	}
	
	mean_time_to_happen = { 
		years = 20 
		modifier = {
			factor = .25
			has_focus = focus_family
		}
	}
	option = {
		name = EVTOPTA_WCRAC_1129
		
		trigger = {
			any_dynasty_member = {
				is_alive = yes
				prisoner = no
				ai = yes
				NOT = { is_friend = ROOT }
				OR = {
					age = 13
					AND = {
						age = 4
						host = { character = ROOT }
					}
				}
			}
		}
		random_dynasty_member = {
			limit = {
				is_alive = yes
				prisoner = no
				ai = yes
				NOT = { is_friend = ROOT }
				OR = {
					age = 13
					AND = {
						age = 4
						host = { character = ROOT }
					}
				}
			}
			character_event = { id = WCRAC.1130 }
		}	
		
		ai_chance = {
			factor = 2
			modifier = {
				factor = 2
				trait = gregarious
			}
			modifier = {
				factor = 1.5
				trait = kind
			}	
		}
	}
	
	option = {
		name = EVTOPTD_WCRAC_1129
		
		ai_chance = {
			factor = .5

			modifier = {
				factor = 1.5
				trait = proud
			}
			modifier = {
				factor = 1.5
				trait = wroth
			}
			modifier = {
				factor = 2
				trait = shy
			}
		}
	}
}
	
# Ping the dynasty member
character_event = {
	id = WCRAC.1130
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			character_event = { id = WCRAC.1131 days = 2 }
		}
	}
}

# The shown event
character_event = {
	id = WCRAC.1131
	
	picture = GFX_evt_Lothraxim_Meet_the_Parents
	border = GFX_event_normal_frame_diplomacy
	desc = EVTDESC_WCRAC_1131
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_WCRAC_1131

		random = {
			chance = 20
			remove_trait = shy
		}
		
		if = {
			limit = {
				is_rival = FROM
			}
			remove_rival = FROM
		}
		
		if = {
			limit = {
				NOT = {
					FROM = {
						personal_opinion = {
							who = ROOT
							value = 50
						}
					}
				}
			}
			FROM = {
				opinion = {
					who = ROOT
					modifier = opinion_family_love
				}
			}
		}
		
		if = {
			limit = {
				NOT = {
					personal_opinion = {
						who = FROM
						value = 50
					}
				}
			}
			opinion = {
				who = FROM
				modifier = opinion_family_love
			}
		}
		
		if = {
			limit = {
				personal_opinion = {
					who = FROM
					value = 50
				}
				reverse_personal_opinion = {
					who = FROM
					value = 50
				}
			}
			add_friend = FROM
		}
	}
}

#Lothraxim Sire Danathrius Dream
character_event = {
	id = WCRAC.1140
	hide_window = no
	title = EVTTITLE_WCRAC_1140
	desc = EVTDESC_WCRAC_1140
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Sire_Denathrius
	
	trigger = {
		has_game_rule = {
				name = lothraxim_stress
				value = on
		}
		trait = creature_lothraxim
		is_adult = yes
		primary_title = {
    				higher_tier_than = duke
		}
		NOR = {
			has_character_modifier = uplifting_visions
			has_character_modifier = frightening_visions
		}	
						
	}
	
	mean_time_to_happen = { 
		years = 40 
		modifier = {
			factor = .75
			primary_title = {
    				higher_tier_than = king
			}	
		}
		modifier = {
			factor = .75
			trait = stressed
		}
		modifier = {
			factor = .75
			trait = depressed
		}
		modifier = {
			factor = .75
			any_owned_bloodline = { 
				has_bloodline_flag = lothraxim_redeemer_bloodline_flag
			}
		}
		modifier = {
			factor = .75
			any_owned_bloodline = { 
				AND = {
					has_bloodline_flag = end_of_legion_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
			}
		}
		modifier = {
			factor = .75
			any_owned_bloodline = { 
				AND = {
					has_bloodline_flag = end_of_scourge_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
			}
		}
		modifier = {
			factor = .75
			any_owned_bloodline = { 
				AND = {
					has_bloodline_flag = end_of_black_empire_bloodline_flag
					founder = {
						trait = creature_lothraxim
					}		
				}
			}
		}
	}

	option = {
		name = EVTOPTA_WCRAC_1140
		
		prestige = -100
		piety = -100
		random = {
			chance = 50
			remove_trait = stressed
		}
		random = {
			chance = 50
			remove_trait = depressed
		}
		ai_chance = {
			factor = 1
			modifier = {
				factor = .5
				trait = proud
			}
			modifier = {
				factor = 2
				trait = craven
			}
		}										
	}

	option = {
		name = EVTOPTB_WCRAC_1140
		
		random = {
			chance = 10
			add_trait = stressed
		}
		random = {
			chance = 10
			add_trait = depressed
		}
		ai_chance = {
			factor = 1
			modifier = {
				factor = 2
				trait = proud
			}
			modifier = {
				factor = .5
				trait = craven
			}
		}																				
	}
	
	option = {
		name = EVTOPTC_WCRAC_1140
		
		trigger = {
			OR = {
				trait = wroth
				trait = cynical
			}
		}
		
		prestige = 100
		
		random = {
			chance = 10
			add_trait = stressed
		}
		random = {
			chance = 10
			add_trait = depressed
		}			

		random_list = {
			50 = {
				add_character_modifier = {
					name = uplifting_visions
					months = 60
				}
			}
			50 = {
				add_character_modifier = {
					name = frightening_visions
					months = 60
				}
			}
		}
		ai_chance = {
			factor = 1

			modifier = {
				factor = 1.5
				trait = wroth
			}
			modifier = {
				factor = 1.5
				trait = cynical
			}
		}												
	}
	
	option = {
		name = EVTOPTD_WCRAC_1140
		
		trigger = {
			OR = {	
				age >= 100

				trait = zealous
				
				any_owned_bloodline = { has_bloodline_flag = lothraxim_redeemer_bloodline_flag }
				
						
				any_owned_bloodline = { 
					AND = { 
						has_bloodline_flag = end_of_legion_bloodline_flag
						founder = {
							trait = creature_lothraxim
						}		
					}
				}
				any_owned_bloodline = { 
					AND = { 
						has_bloodline_flag = end_of_scourge_bloodline_flag
						founder = {
							trait = creature_lothraxim
						}		
					}
				}
				any_owned_bloodline = { 
					AND = { 
						has_bloodline_flag = end_of_black_empire_bloodline_flag
						founder = {
							trait = creature_lothraxim
						}		
					}
				}		
			}
		}

		piety = 100

		random = {
			chance = 25
			add_character_modifier = {
					name = uplifting_visions
					months = 60
			}
		}			

		ai_chance = {
			factor = 4
		}	
	}
}

# Orphans at Fair Event for Lothraxim Male
character_event = {
	id = WCRAC.1150
	title = EVTTITLE_WCRAC_1150
	desc = EVTDESC_WCRAC_1150
	picture = GFX_evt_Nathrezim_Orphans
	border = GFX_event_normal_frame_diplomacy
	hide_window = no
	
	trigger = {
		has_game_rule = {
				name = lothraxim_family
				value = on
		}
		trait = creature_lothraxim
		is_adult = yes
		has_character_modifier = holding_summer_fair
		is_female = no
		capital_scope = {
			NOT = { has_province_modifier = peasants_upset }
		}
		
		NOT = { has_character_flag = lothraxim_orphan_flag }
	}
	mean_time_to_happen = {
	days = 180
		modifier = {
			factor = 0.33
			NOT = { has_character_flag = fair_event_happened }
		}	
		
		modifier = {
			factor = 1.5
			has_character_flag = fair_event_happened
		}			
	}
	
	immediate = {
		set_character_flag = lothraxim_orphan_flag
	}

	option = {
		name = EVTOPTA_WCRAC_1150
		
		random = {
			chance = 25
			add_trait = just
		}			

		ai_chance = {
			factor = 1
		}
	}

	option = {
		name = EVTOPTB_WCRAC_1150

		random = {
			chance = 25
			add_trait = charitable
		}			
		wealth = -50
		
		piety = 50
		
		ai_chance = {
			factor = 1
		}
	}	

	option = {
		name = EVTOPTC_WCRAC_1150
		set_character_flag = took_in_orphan_flag
		
		ai_chance = {
			factor = 2
		}
		
		random_list = {
			5 = {
				create_character = {
					culture = high_elf
					graphical_culture = highelfgfx
					trait = creature_high_elf
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}
			}
			5 = {		
				create_character = {
					culture = zandalari
					graphical_culture = zandalarigfx
					trait = creature_troll
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}
			}					
			5 = {
				create_character = {
					culture = frostwolf
					graphical_culture = orcgfx
					trait = creature_orc
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}
			}
			5 = {
				create_character = {
					culture = bronzebeard
					graphical_culture = dwarfgfx
					trait = creature_dwarf
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}
			}
			5 = {
				create_character = {
					culture = ogre
					graphical_culture = ogregfx
					trait = creature_ogre
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}	
				}
				new_character = {
						set_character_flag = shrek_flag
				}
			}
			5 = {
				create_character = {
					culture = goblin
					graphical_culture = goblingfx
					trait = creature_goblin 
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}
			}
			5 = {
				create_character = {
					culture = vrykul
					graphical_culture = vrykulgfx
					trait = creature_vrykul
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}
			}
			5 = {
				create_character = {
					culture = eredar
					graphical_culture = eredargfx
					trait = creature_eredar
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}
			}
			5 = {
				create_character = {
					culture = lordaeronian
					graphical_culture = lordaerongfx
					trait = creature_human
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}
			}
			5 = {
				create_character = {
					culture = draenei
					graphical_culture = draeneigfx
					trait = creature_draenei
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}
			}
			5 = {
				create_character = {
					culture = night_elf
					graphical_culture = nightelfgfx
					trait = creature_night_elf
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}
			}
			5 = {
				create_character = {
					culture = highborne
					graphical_culture = highbornegfx
					trait = creature_highborne
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}
			}
			5 = {
				create_character = {
					culture = tauren
					graphical_culture = taurengfx
					trait = creature_tauren
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}
			}
			5 = {
				create_character = {
					culture = tolvir
					graphical_culture = tolvirgfx
					trait = creature_tolvir
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}
			}
			5 = {
				create_character = {
					culture = wandering_pandaren
					graphical_culture = pandarengfx
					trait = creature_pandaren
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}
			}
			5 = {
				create_character = {
					culture = vulpera
					graphical_culture = vulperagfx
					trait = creature_vulpera
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}
			}
			5 = {
				create_character = {
					culture = sethrak
					graphical_culture = sethrakgfx
					trait = creature_sethrak
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}
			}
			5 = {
				create_character = {
					culture = grummle
					graphical_culture = grummlegfx
					trait = creature_grummle
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}
			}
			5 = {
				create_character = {
					culture = mogu
					graphical_culture = mogugfx
					trait = creature_mogu
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}
			}
			5 = {
				create_character = {
					culture = saurok
					graphical_culture = saurokgfx
					trait = creature_saurok
					female = no
					age = 12
					trait = strong
					trait = wrothful
					trait = stubborn
					trait = envious
					trait = proud
					trait = greedy
					dynasty = none
					health = 7
					religion = ROOT
					attributes = {
						martial = 15
					}
				}		
			}
		}
			
	}
			
	option = {
		name = EVTOPTD_WCRAC_1150
		tooltip_info = combat_rating
		
		trigger = {
			combat_rating >= 0
		}

		add_trait = cruel
		prestige = 10
		piety = -10

		if = {
			limit = {
				combat_rating >= 150
			}
			
			random_list = {
				90 = {
					prestige = 10
				}
					
				5 = {
					add_trait = wounded
				}
				5 = {
					add_character_modifier = { 
						name = black_eye
						months = 60 
					}
				}
			}	
		}	
	
		else_if = {
			limit = {
				combat_rating >= 100
			}
			
			random_list = {
				90 = {
					increase_duel_exp_modifier_effect = yes
				}

				5 = {
					add_trait = wounded
				}
				5 = {
					add_character_modifier = { 
						name = black_eye
						months = 60 
					}
				}
			}	
		}
		else_if = {
			limit = {
				combat_rating >= 50
			}
			
			random_list = {
				75 = {
					increase_duel_exp_modifier_effect = yes
				}
				10 = {
					add_trait = wounded
				}
				15 = {
					add_character_modifier = { 
						name = black_eye
						months = 60 
					}
				}
			}	
		}
		else = {
			limit = {
				combat_rating >= 0
			}
			
			random_list = {
				50 = {
					increase_duel_exp_modifier_effect = yes
				}
				25 = {
					add_trait = wounded
				}
				25 = {
					add_character_modifier = { 
						name = black_eye
						months = 60 
					}
				}
			}	
		}		

		ai_chance = {
			factor = .25
			modifier = {
				factor = 2
				trait = wroth
			}
			modifier = {
				factor = 2
				trait = cruel
			}
		}
	}
}

# Clears lothraxim_orphan_flag
character_event = {
	id = WCRAC.1151
	
	hide_window = yes
	
	trigger = {
		had_character_flag = {
    			flag = lothraxim_orphan_flag
   			years >= 5
		}
	}
	mean_time_to_happen = {
	days = 1
	}
	
	immediate = {

		clr_character_flag = lothraxim_orphan_flag
	}
}

# Orphans at Fair Event for Lothraxim Female
character_event = {
	id = WCRAC.1152
	title = EVTTITLE_WCRAC_1152
	desc = EVTDESC_WCRAC_1152
	picture = GFX_evt_Sayaad_Orphans
	border = GFX_event_normal_frame_diplomacy
	hide_window = no
	
	trigger = {
		has_game_rule = {
				name = lothraxim_family
				value = on
		}
		trait = creature_lothraxim
		is_adult = yes
		has_character_modifier = holding_summer_fair
		is_female = yes
		capital_scope = {
			NOT = { has_province_modifier = peasants_upset }
		}
		
		NOT = { has_character_flag = lothraxim_orphan_flag }
	}
	mean_time_to_happen = {
	days = 180
		modifier = {
			factor = 0.33
			NOT = { has_character_flag = fair_event_happened }
		}	
		
		modifier = {
			factor = 1.5
			has_character_flag = fair_event_happened
		}			
	}
	
	immediate = {
		set_character_flag = lothraxim_orphan_flag
	}

	option = {
		name = EVTOPTA_WCRAC_1152
		
		wealth = -10
		
		random = {
			chance = 25
			add_trait = kind
		}
		
	}

	option = {
		name = EVTOPTB_WCRAC_1152

		piety = -10

		random = {
			chance = 25
			add_trait = paranoid
		}
	}

	
	option = {
		name = EVTOPTC_WCRAC_1152

		add_trait = charitable
		wealth = -100

		create_character = {
			culture = random
			dynasty = none
			female = random
			health = 7
			religion = ROOT
			age = 11	
			random_traits = yes	
		}
		new_character = {
			random_list = { 
				10 = {
					add_age = 2
				}
				10 = {
					add_age = 1
				}
				10 = {
					add_age = 0
				}
				10 = {
					add_age = -1
				}
				10 = {
					add_age = -2
				}
				10 = {
					add_age = -3
				}
				10 = {
					add_age = -4
				}
				10 = {
					add_age = -5
				}
				10 = {
					add_age = -6
				}
				10 = {
					add_age = -7
				}
			}
			character_event = { id = WCRAC.10 }
		}
		create_character = {
			culture = random
			dynasty = none
			female = random
			health = 7
			religion = ROOT
			age = 11	
			random_traits = yes	
		}
		new_character = {
			random_list = { 
				10 = {
					add_age = 2
				}
				10 = {
					add_age = 1
				}
				10 = {
					add_age = 0
				}
				10 = {
					add_age = -1
				}
				10 = {
					add_age = -2
				}
				10 = {
					add_age = -3
				}
				10 = {
					add_age = -4
				}
				10 = {
					add_age = -5
				}
				10 = {
					add_age = -6
				}
				10 = {
					add_age = -7
				}
			}
			character_event = { id = WCRAC.10 }
		}
		create_character = {
			culture = random
			dynasty = none
			female = random
			health = 7
			religion = ROOT
			age = 11	
			random_traits = yes	
		}
		new_character = {
			random_list = { 
				10 = {
					add_age = 2
				}
				10 = {
					add_age = 1
				}
				10 = {
					add_age = 0
				}
				10 = {
					add_age = -1
				}
				10 = {
					add_age = -2
				}
				10 = {
					add_age = -3
				}
				10 = {
					add_age = -4
				}
				10 = {
					add_age = -5
				}
				10 = {
					add_age = -6
				}
				10 = {
					add_age = -7
				}
			}
			character_event = { id = WCRAC.10 }
		}
		create_character = {
			culture = random
			dynasty = none
			female = random
			health = 7
			religion = ROOT
			age = 11	
			random_traits = yes	
		}
		new_character = {
			random_list = { 
				10 = {
					add_age = 2
				}
				10 = {
					add_age = 1
				}
				10 = {
					add_age = 0
				}
				10 = {
					add_age = -1
				}
				10 = {
					add_age = -2
				}
				10 = {
					add_age = -3
				}
				10 = {
					add_age = -4
				}
				10 = {
					add_age = -5
				}
				10 = {
					add_age = -6
				}
				10 = {
					add_age = -7
				}
			}
			character_event = { id = WCRAC.10 }
		}
		create_character = {
			culture = random
			dynasty = none
			female = random
			health = 7
			religion = ROOT
			age = 11	
			random_traits = yes	
		}
		new_character = {
			random_list = { 
				10 = {
					add_age = 2
				}
				10 = {
					add_age = 1
				}
				10 = {
					add_age = 0
				}
				10 = {
					add_age = -1
				}
				10 = {
					add_age = -2
				}
				10 = {
					add_age = -3
				}
				10 = {
					add_age = -4
				}
				10 = {
					add_age = -5
				}
				10 = {
					add_age = -6
				}
				10 = {
					add_age = -7
				}
			}
			character_event = { id = WCRAC.10 }
		}			
	}
	option = {
		name = EVTOPTD_WCRAC_1152

		character_event = { id = WCRAC.1153 }
	}
}
	
	
# Sayaad Chooses Orphan to Adopt
character_event = {
	id = WCRAC.1153
	title = EVTTITLE_WCRAC_1153
	desc = EVTDESC_WCRAC_1153
	picture = GFX_evt_Sayaad_Orphans
	border = GFX_event_normal_frame_diplomacy
	hide_window = no

	is_triggered_only = yes

	immediate = {
		create_character = {
			age = 11
			female = random
			attributes = { 
				martial = 10
				diplomacy = 2
				stewardship = 2
				intrigue = 2
				learning = 2 
			}
			dynasty = none
			religion = ROOT
			culture = random
			random_traits = yes
		}
		new_character = {
			remove_trait = slow
			remove_trait = imbecile
			remove_trait = dull
			remove_trait = craven
			remove_trait = feeble
			remove_trait = weak
			random = {
				chance = 50
				add_trait = brave
			}
			random = {
				chance = 50
				add_trait = gregarious
			}
			random = {
				chance = 50
				add_trait = haughty
			}
			random_list = { 
				50 = {
					add_trait = strong
				}
				50 = {
					add_trait = robust
				}
			}
			random_list = { 
				10 = {
					add_age = 2
				}
				10 = {
					add_age = 1
				}
				10 = {
					add_age = 0
				}
				10 = {
					add_age = -1
				}
				10 = {
					add_age = -2
				}
				10 = {
					add_age = -3
				}
				10 = {
					add_age = -4
				}
				10 = {
					add_age = -5
				}
				10 = {
					add_age = -6
				}
				10 = {
					add_age = -7
				}
			}
			character_event = { id = WCRAC.10 }
			save_event_target_as = brawny_kid
		}
		
		create_character = {
			age = 11
			female = random
			attributes = { 
				martial = 2
				diplomacy = 10
				stewardship = 2
				intrigue = 2
				learning = 2 
			}
			dynasty = none
			religion = ROOT
			culture = random
			random_traits = yes
		}
		new_character = {
			remove_trait = slow
			remove_trait = imbecile
			remove_trait = dull
			remove_trait = timid
			remove_trait = shy
			remove_trait = cruel
			remove_trait = feeble
			remove_trait = weak
			random = {
				chance = 50
				add_trait = kind
			}
			random = {
				chance = 50
				add_trait = honest
			}
			random = {
				chance = 50
				add_trait = gregarious
			}
			random_list = { 
				50 = {
					add_trait = fair
				}
				50 = {
					add_trait = groomed
				}
			}
			random_list = { 
				10 = {
					add_age = 2
				}
				10 = {
					add_age = 1
				}
				10 = {
					add_age = 0
				}
				10 = {
					add_age = -1
				}
				10 = {
					add_age = -2
				}
				10 = {
					add_age = -3
				}
				10 = {
					add_age = -4
				}
				10 = {
					add_age = -5
				}
				10 = {
					add_age = -6
				}
				10 = {
					add_age = -7
				}
			}
			character_event = { id = WCRAC.10 }
			save_event_target_as = likable_kid
		}
		create_character = {
			age = 11
			female = random
			attributes = { 
				martial = 3
				diplomacy = 3
				stewardship = 3
				intrigue = 3
				learning =  3
			}
			dynasty = none
			religion = ROOT
			culture = random
			random_traits = yes
		}
		new_character = {
			remove_trait = slow
			remove_trait = imbecile
			remove_trait = dull
			remove_trait = feeble
			remove_trait = weak
			random = {
				chance = 50
				add_trait = erudite
			}
			random = {
				chance = 20
				add_trait = timid
			}
			random = {
				chance = 20
				add_trait = shrewd
			}
			random_list = { 
				50 = {
					add_trait = genius
				}
				50 = {
					add_trait = quick
				}
			}
			random_list = { 
				10 = {
					add_age = 2
				}
				10 = {
					add_age = 1
				}
				10 = {
					add_age = 0
				}
				10 = {
					add_age = -1
				}
				10 = {
					add_age = -2
				}
				10 = {
					add_age = -3
				}
				10 = {
					add_age = -4
				}
				10 = {
					add_age = -5
				}
				10 = {
					add_age = -6
				}
				10 = {
					add_age = -7
				}
			}
			
			character_event = { id = WCRAC.10 }
			save_event_target_as = brainy_kid
		}
	}
	option = {
		name = EVTOPTA_WCRAC_1153

		event_target:brawny_kid = {
			show_scope_change = no
			prev_adopts_effect = yes
		}
		
		hidden_effect = {
			event_target:brainy_kid = { leave_court_and_die_effect = yes }
		}
		
		hidden_effect = {
			event_target:likable_kid = { leave_court_and_die_effect = yes }
		}

		ai_chance = {
			factor = 1
		}
	}
	option = {
		name = EVTOPTB_WCRAC_1153

		event_target:likable_kid = {
			show_scope_change = no
			prev_adopts_effect = yes
		}

		hidden_effect = {
			event_target:brawny_kid = { leave_court_and_die_effect = yes }
		}	
		
		hidden_effect = {
			event_target:brainy_kid = { leave_court_and_die_effect = yes }
		}
		ai_chance = {
			factor = 1
		}
	}
	option = {
		name = EVTOPTC_WCRAC_1153

		event_target:brainy_kid = {
			show_scope_change = no
			prev_adopts_effect = yes
		}

		hidden_effect = {
			event_target:brawny_kid = { leave_court_and_die_effect = yes }
		}
		hidden_effect = {
			event_target:likable_kid = { leave_court_and_die_effect = yes }
		}
		ai_chance = {
			factor = 2
		}
	}
	option = {
		name = EVTOPTD_WCRAC_1153

		piety = -5

		hidden_effect = {
			event_target:brawny_kid = { leave_court_and_die_effect = yes }
		}
		hidden_effect = {
			event_target:likable_kid = { leave_court_and_die_effect = yes }
		}	
		hidden_effect = {
			event_target:brainy_kid = { leave_court_and_die_effect = yes }
		}
		ai_chance = {
			factor = .25
		}
	}
}

#Lothraxim Secretly Fel Worshipper
character_event = {
	id = WCRAC.1160
	hide_window = no
	title = EVTTITLE_WCRAC_1128
	desc = EVTDESC_WCRAC_1160
	border = GFX_event_normal_frame_intrigue
	picture = { 
		trigger = { 
			is_female = no
		}
		picture = GFX_evt_Lothraxim_Inner_Struggle
	}
	picture = { 
		trigger = { 
			is_female = yes
		} 
		picture = GFX_evt_Lothraxim_Inner_Struggle_Female
	}
	
	
	trigger = {
		has_game_rule = {
				name = lothraxim_stress
				value = on
		}
		AND = {
			trait = creature_lothraxim
			is_adult = yes
			secret_religion = burning_legion_religion
		}
	}
	
	mean_time_to_happen = { 
		years = 5 
		modifier = {
			factor = 2
			trait = craven
		}
	}
		
	option = {
		name = EVTOPTA_WCRAC_1160
		random = {
			chance = 50
			add_trait = craven
		}
		if = {
   			limit = {
				NOT = {
					trait = stressed
  				}
			}
			random = {
				chance = 50
				add_trait = stressed				
			}
		}				
		else = {
   			limit = {
				NOT = {
    					trait = depressed
  				}
			}
			random = {
				chance = 50
				add_trait = depressed
			}
		}
		ai_chance = {
			factor = 1
			modifier = {
				factor = 2
				trait = craven
			}
		}
	}
	option = {
		name = EVTOPTB_WCRAC_1160
		
		convert_to_secret_religion = yes
		
		random = {
			chance = 50
			add_trait = brave
		}
		ai_chance = {
			factor = .5
			modifier = {
				factor = 1.5
				trait = proud
			}
			modifier = {
				factor = 1.5
				trait = brave
			}
		}
	}
	option = {
		name = EVTOPTC_WCRAC_1160
		clear_secret_religion = yes
		add_trait = stressed
		add_trait = depressed
	
		ai_chance = {
			factor = 1
			modifier = {
				factor = 2
				trait = kind
			}
			modifier = {
				factor = 2
				OR = { 
					any_owned_bloodline = { has_bloodline_flag = lothraxim_redeemer_bloodline_flag }
				
						
					any_owned_bloodline = { 
						AND = { 
							has_bloodline_flag = end_of_legion_bloodline_flag
							founder = {
								trait = creature_lothraxim
							}		
						}
					}
					any_owned_bloodline = { 
						AND = { 
							has_bloodline_flag = end_of_scourge_bloodline_flag
							founder = {
								trait = creature_lothraxim
							}		
						}
					}
					any_owned_bloodline = { 
						AND = { 
							has_bloodline_flag = end_of_black_empire_bloodline_flag
							founder = {
								trait = creature_lothraxim
							}		
						}
					}		
				}
			}
		}
		
	}
	option = {
		name = EVTOPTD_WCRAC_1160
		trigger = {
			shadow_council = { 
				society_is_active = yes
			}
		}

			
		if = {
   			limit = {
				NOT = {
					society_member_of = shadow_council
  				}
			}
			leave_society = yes
			join_society = shadow_council
		}				
		else = {
   			limit = {
				society_member_of = shadow_council
			}
			change_society_currency = 200	
		}
		ai_chance = {
			factor = 1
			modifier = {
				factor = 5
				society_member_of = shadow_council
			}
		}
	}		
}

#Lothraxim Scarlet Light Worshipper
character_event = {
	id = WCRAC.1161
	hide_window = no
	title = EVTTITLE_WCRAC_1128
	desc = EVTDESC_WCRAC_1161
	border = GFX_event_normal_frame_intrigue
	picture = { 
		trigger = { 
			is_female = no
		}
		picture = GFX_evt_Lothraxim_Inner_Struggle
	}
	picture = { 
		trigger = { 
			is_female = yes
		} 
		picture = GFX_evt_Lothraxim_Inner_Struggle_Female
	}
	
	
	trigger = {
		has_game_rule = {
				name = lothraxim_stress
				value = on
		}
		AND = {
			trait = creature_lothraxim
			is_adult = yes
			religion = scarlet_light
		}
	}
	
	mean_time_to_happen = { 
		years = 4
		modifier = {
			factor = .75
			trait = stressed
		}
		modifier = {
			factor = .75
			trait = depressed
		}
		modifier = {
			factor = .75
			trait = wounded
		}
		modifier = {
			factor = .75
			trait = severely_injured
		}
	}
		
	option = {

		name= {
 			text = EVTOPTA_WCRAC_1161
 		
			trigger = {
				NOT = { 
					AND = {
						trait = stressed
						trait = depressed
					}
				}
			}	
		}
		name = {
  			text = EVTOPTB_WCRAC_1161
 	 		
			trigger = {
    				AND = {
					trait = stressed
					trait = depressed
				}
  			}
		}
		
		prestige = -100
		
		if = {
			limit = {
				trait = stressed
				trait = depressed
				trait = severely_injured 
			}
			death = {
    				death_reason = death_suicide
    				killer = ROOT
			}
		}
		else_if = {
			limit = {
				trait = stressed
				trait = depressed
				trait = wounded
			}
			add_trait = severely_injured 
		}
		else_if = {
   			limit = {
				trait = stressed
				trait = depressed
			}
			add_trait = wounded	
		}				
		else_if = {
   			limit = {
				NOT = {
					trait = stressed
  				}
			}
			add_trait = stressed				
		}				
		else = {
   			limit = {
				NOT = {
    					trait = depressed
  				}
			}
			add_trait = depressed
		}
		ai_chance = {
			factor = .5
			modifier = {
				factor = .5
				trait = cynical
			}
			modifier = {
				factor = 2
				trait = depressed
			}
			modifier = {
				factor = 2
				trait = possessed 
			}
			modifier = {
				factor = 2
				trait = lunatic
			}
		}
	}
	option = {
		name = EVTOPTC_WCRAC_1161
		
		religion = holy_light
		
		ai_chance = {
			factor = 1
			modifier = {
				factor = 1.5
				trait = proud
			}
			modifier = {
				factor = 1.5
				trait = brave
			}
			modifier = {
				factor = 2
				secret_religion = holy_light
			}
		}
	}
	option = {
		name = EVTOPTD_WCRAC_1161
		
		piety = -100
		add_trait = cynical
		

		if = {
			limit = {
				OR = {
					has_character_modifier = vicious_rumors
					has_character_modifier = vicious_rumors_2
				}
			}
			add_character_modifier = { 
				name = vicious_rumors_2
				months = 60 
			}
		}
		
		else = {
			add_character_modifier = { 
				name = vicious_rumors
				months = 60 
			}
		}
		ai_chance = {
			factor = 1
			modifier = {
				factor = 2
				trait = cynical
			}
		}	
	}
	option = {
		name= {
 			text = EVTOPTE_WCRAC_1128
 		
			trigger = {
				NOT = { 
					secret_religion = burning_legion_religion
				}
			}	
		}
		name = {
  			text = EVTOPTF_WCRAC_1128
 	 		
			trigger = {
    				secret_religion = burning_legion_religion
  			}
		}
		
		if = {
			limit = {
				OR = {
					has_secret_religion = no

					AND = {
						has_secret_religion = yes
						NOT = {
							secret_religion = burning_legion_religion
						}
					}
				}
			}
			set_secret_religion = burning_legion_religion
		}	
		else_if = {
   			limit = {
				NOT = {
					society_member_of = shadow_council
  				}
			}
			leave_society = yes
			join_society = shadow_council
		}				
		else = {
   			limit = {
				society_member_of = shadow_council
			}
			change_society_currency = 200	
		}
		ai_chance = {
			factor = .5
			modifier = {
				factor = 5
				society_member_of = shadow_council
			}
		}
	}		
}

# Mob Celebrates Lothraxim Ruler for Bloodline
character_event = {
	id = WCRAC.1170
	title = EVTTITLE_WCRAC_1170
	desc = EVTDESC_WCRAC_1170
	border = GFX_event_normal_frame_diplomacy
	hide_window = no
	picture = { 
		trigger = { 
			is_female = no
		}
		picture = GFX_evt_Prodemon_Crowd
	}
	picture = { 
		trigger = { 
			is_female = yes
		} 
		picture = GFX_evt_Prodemoness_Crowd
	}

	is_triggered_only = yes

	trigger = {
		trait = creature_lothraxim
		has_character_flag = pacified_antidemon_rioters_flag
		is_landed = yes
		primary_title = {
    				higher_tier_than = count
		}			
	}
		
	immediate = {
		clr_character_flag = pacified_antidemon_rioters_flag
	}
	
	option = {
		name = EVTOPTA_WCRAC_1170

		prestige = 200
	}
}

# Lothraxim Ruler Message from Ogre Ward
letter_event = {
	id = WCRAC.1179
	
	desc = EVTDESC_WCRAC_1181

	is_triggered_only = yes

	trigger = {
		trait = creature_lothraxim
		is_adult = yes
		is_female = no
		has_character_flag = took_in_orphan_flag

	}
	option = {
		name = EVTOPTA_WCRAC_1181

		wealth = -100

		FROM = {
			wealth = 100
		}
		add_friend = FROM
	}
	option = {
		name = EVTOPTB_WCRAC_1181
	}
	option = {
		name = EVTOPTC_WCRAC_1181
	
		add_alliance = {
			who = FROM
			years = 100
		}
		join_attacker_wars = FROM

		add_friend = FROM	
	}
}


# Ogre Ward Sets Out
character_event = {
	id = WCRAC.1180
	hide_window = yes

	trigger = {
		trait = creature_ogre
		has_character_flag = shrek_flag
		is_landed = no
		age = 16
		age < 22
		prisoner = no

		NOT = {
			has_global_flag = shrek_goes_forth_flag
		}			
	}

	mean_time_to_happen = { 
		days = 30
	}
		
	immediate = {
		
		set_global_flag = shrek_goes_forth_flag
		save_event_target_as = child_of_destiny

		add_trait = ambitious
		add_trait = stubborn
		add_trait = strong
		remove_trait = slow
		remove_trait = imbecile
		remove_trait = dull
		remove_trait = feeble
		remove_trait = weak
		add_claim = c_rotting_mire
		
		random_list = {
			10 = {
				change_learning = 5
			}
			10 = {
				change_martial = 5
			}
			10 = {
				change_diplomacy = 5
			}
			10 = {
				change_intrigue = 5
			}
			10 = {
				change_stewardship = 5
			}
			10 = {
				change_learning = 3
			}
			10 = {
				change_martial = 3
			}
			10 = {
				change_diplomacy = 3
			}
			10 = {
				change_intrigue = 3
			}
			10 = {
				change_stewardship = 3
			}
		}
		
		random_independent_ruler = {
			limit = {
				# Warcraft
				can_be_attacked_by_adventurer_trigger = yes
				
				ai = yes
				is_tributary = no
				is_landed = yes
				independent = yes
				NOT = { is_vassal_or_below = event_target:child_of_destiny }
				realm_size = 25
				event_target:child_of_destiny = {
					NOR = {
						obedient = PREV
						non_interference = PREV
						has_non_aggression_pact_with = PREV
						top_liege = {
							distance_from_realm = { who = PREVPREV value = 1200 }
						}
					}
				}
			}
			preferred_limit = {
				distance_from_realm = { who = PREV value = 200 }
				NOT = {
					distance_from_realm = { who = PREV value = 800 }
				}
				NOT = {
					any_realm_character = {
						ai = no
					}
				}
				is_nomadic = no
			}
			preferred_limit = {
				distance_from_realm = { who = PREV value = 200 }
				NOT = {
					distance_from_realm = { who = PREV value = 800 }
				}
				NOT = {
					any_realm_character = {
						ai = no
					}
				}
				is_nomadic = no
			}
			preferred_limit = {
				distance_from_realm = { who = PREV value = 200 }
				NOT = {
					distance_from_realm = { who = PREV value = 800 }
				}
				is_nomadic = no
			}
			preferred_limit = {
				distance_from_realm = { who = PREV value = 200 }
				NOT = {
					distance_from_realm = { who = PREV value = 1000 }
				}
				NOT = {
					any_realm_character = {
						ai = no
					}
				}
				is_nomadic = no
			}
			preferred_limit = {
				distance_from_realm = { who = PREV value = 200 }
				NOT = {
					distance_from_realm = { who = PREV value = 1000 }
				}
				is_nomadic = no
			}
			preferred_limit = {
				distance_from_realm = { who = PREV value = 150 }
				NOT = {
					distance_from_realm = { who = PREV value = 1100 }
				}
				NOT = {
					any_realm_character = {
						ai = no
					}
				}
				is_nomadic = no
			}
			preferred_limit = {
				distance_from_realm = { who = PREV value = 150 }
				NOT = {
					distance_from_realm = { who = PREV value = 1100 }
				}
				is_nomadic = no
			}
			preferred_limit = {
				distance_from_realm = { who = PREV value = 200 }
				NOT = {
					distance_from_realm = { who = PREV value = 800 }
				}
				NOT = {
					any_realm_character = {
						ai = no
					}
				}
			}
			preferred_limit = {
				distance_from_realm = { who = PREV value = 200 }
				NOT = {
					distance_from_realm = { who = PREV value = 800 }
				}
				NOT = {
					any_realm_character = {
						ai = no
					}
				}
			}
			preferred_limit = {
				distance_from_realm = { who = PREV value = 200 }
				NOT = {
					distance_from_realm = { who = PREV value = 800 }
				}
			}
			preferred_limit = {
				distance_from_realm = { who = PREV value = 200 }
				NOT = {
					distance_from_realm = { who = PREV value = 1000 }
				}
				NOT = {
					any_realm_character = {
						ai = no
					}
				}
			}
			preferred_limit = {
				distance_from_realm = { who = PREV value = 200 }
				NOT = {
					distance_from_realm = { who = PREV value = 1000 }
				}
			}
			preferred_limit = {
				distance_from_realm = { who = PREV value = 150 }
				NOT = {
					distance_from_realm = { who = PREV value = 1100 }
				}
				NOT = {
					any_realm_character = {
						ai = no
					}
				}
			}
			preferred_limit = {
				distance_from_realm = { who = PREV value = 150 }
				NOT = {
					distance_from_realm = { who = PREV value = 1100 }
				}
			}
			save_event_target_as = target_character
		}
		if = {
			limit = {
				is_landed = yes
				independent = no
			}
			liege = { save_event_target_as = liege_title_target }
			any_demesne_title = {
				grant_title = event_target:liege_title_target
			}
			any_vassal = {
				set_defacto_liege = event_target:liege_title_target
			}
		}
		else = {
			limit = {
				is_landed = yes
				independent = yes
			}
			transfer_crown_on_abdication_effect = yes
			abdicate = yes
		}
		liege = {

			letter_event = {
				id = WCRAC.1179
			}

			capital_scope = {
				event_target:target_character = {
					random_realm_province = {
						event_target:child_of_destiny = {
							set_defacto_liege = event_target:child_of_destiny
							create_title = {
								tier = DUKE
								landless = yes
								temporary = yes
								adventurer = yes
								culture = event_target:child_of_destiny
								name = "CLAIMANT_ADVENTURE"
								holder = event_target:child_of_destiny
							}
							
							set_character_flag = duchy_adventurer
						
							create_character = {
								age = 16
								female = no
								attributes = { 
									martial = 10
									diplomacy = 5
									stewardship = 5
									intrigue = 15
									learning =  5
								}
								dynasty = none
								employer = event_target:child_of_destiny 
								religion = ROOT
								culture = tolvir
								random_traits = yes
							}
							new_character = {
								remove_trait = slow
								remove_trait = imbecile
								remove_trait = dull
								remove_trait = feeble
								remove_trait = weak
								add_trait = duelist
								add_trait = gregarious
								add_trait = quick
								add_friend = event_target:child_of_destiny
							}
							spawn_unit = {
								province = PREVPREVPREV
								home = PREVPREVPREV
								owner = THIS
								match_character = PREVPREV
								match_mult = 0.66
								match_min = 1000
								match_max = 10000
								reinforces = yes
								reinforce_rate_multiplier = 0.25
								merge = yes
								attrition = 0.25
								cannot_inherit = yes
							}
							spawn_unit = {
								province = PREVPREVPREV
								home = PREVPREVPREV
								owner = THIS
								match_character = PREVPREV
								match_mult = 0.66
								match_min = 1000
								match_max = 10000
								reinforces = yes
								reinforce_rate_multiplier = 0.25
								merge = yes
								attrition = 0.25
								cannot_inherit = yes
							}
							spawn_unit = {
								province = PREVPREVPREV
								home = PREVPREVPREV
								owner = THIS
								match_character = PREVPREV
								match_mult = 0.66
								match_min = 1000
								match_max = 10000
								reinforces = yes
								reinforce_rate_multiplier = 0.25
								merge = yes
								attrition = 0.25
								cannot_inherit = yes
							}
							spawn_unit = {
								province = PREVPREVPREV
								home = PREVPREVPREV
								owner = THIS
								troops = {
									animals = { 2500 2500 }
									dragons = { 2500 2500 }
   								}
								reinforces = yes
								reinforce_rate_multiplier = 0.25
								merge = yes
								attrition = 0.25
								cannot_inherit = yes
							}
							spawn_fleet = {
								province = closest # closest sea zone
								owner = THIS
								cannot_inherit = yes
								troops =
								{
									galleys = { 300 300 }
								}
							}
							unsafe_war = {
								target = PREVPREV
								casus_belli = kingdom_adventure
								thirdparty_title = PREV
								tier = KING
							}
							
							create_character = {
								age = 16
								female = no
								attributes = { 
									martial = 3
									diplomacy = 15
									stewardship = 3
									intrigue = 3
									learning =  3
								}
								dynasty = none
								employer = event_target:child_of_destiny 
								religion = ROOT
								culture = yaungol
								random_traits = yes
							}
							new_character = {
								remove_trait = slow
								remove_trait = imbecile
								remove_trait = dull
								remove_trait = feeble
								remove_trait = weak
								add_trait = stubborn
								add_trait = gregarious
								add_trait = socializer
								add_friend = event_target:child_of_destiny
							}
							create_character = {
								age = 16
								female = yes
								attributes = { 
									martial = 5
									diplomacy = 10
									stewardship = 5
									intrigue = 5
									learning =  5
								}
								dynasty = none
								employer = event_target:child_of_destiny 
								religion = ROOT
								culture = ogre
								random_traits = yes
							}
							new_character = {
								remove_trait = slow
								remove_trait = imbecile
								remove_trait = dull
								remove_trait = feeble
								remove_trait = weak
								add_trait = fair
								add_trait = robust
								add_trait = patient
								event_target:child_of_destiny = { prev_add_spouse_this_effect = yes }
								add_lover = event_target:child_of_destiny
							}
							create_character = {
								age = 16
								female = yes
								attributes = { 
									martial = 20
									diplomacy = 2
									stewardship = 10
									intrigue = 2
									learning =  2
								}
								dynasty = none
								employer = event_target:child_of_destiny 
								religion = ROOT
								culture = red_dragon
								random_traits = yes
							}
							new_character = {
								remove_trait = slow
								remove_trait = imbecile
								remove_trait = dull
								remove_trait = feeble
								remove_trait = weak
								add_trait = lustful
								add_trait = hunter
								add_trait = wroth
								add_trait = strong
								add_friend = event_target:child_of_destiny
							}
						}
					}
				}
			}
		}
		
		if = {
			limit = {
				any_war = {
					using_cb = kingdom_adventure
				}
			}
			spawn_fantastic_commander_effect = yes
			spawn_fantastic_commander_effect = yes
			spawn_fantastic_commander_effect = yes
		}
		else = {
			clr_global_flag = shrek_goes_forth_flag
		}
	}
}

# Clear Took in Orphan Flag
character_event = {
	id = WCRAC.1182
	hide_window = yes

	trigger = {
		trait = creature_lothraxim
		had_character_flag = {
    			flag = took_in_orphan_flag
   			years >= 10
		}
	}

	mean_time_to_happen = { 
		days = 1
	}
		
	immediate = {
		clr_character_flag = took_in_orphan_flag
	}
}

# Clear Shrek Goes Forth Flag
character_event = {
	id = WCRAC.1183
	hide_window = yes

	trigger = {
		had_global_flag = {
    			flag = shrek_goes_forth_flag
   			years >= 100
		}
	}

	mean_time_to_happen = { 
		days = 1
	}
		
	immediate = {
		clr_global_flag = shrek_goes_forth_flag
	}
}
# Lothraxus Setup Events

character_event = {
	id = WCRAC.1190
	hide_window = no
	title = EVTTITLE_WCRAC_1190
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Lothraxus_Saved	
	desc = EVTDESC_WCRAC_1190
	min_age = 18
	max_age = 19
	has_character_flag = is_lothraxus
	
	trigger = { 
		NOT = { has_character_flag = lothraxus_saved } 
	}

	mean_time_to_happen = {
	days = 1
	}
	
	option = {
	
		name = EVTOPTA_WCRAC_1190

		set_character_flag = lothraxus_saved
		set_character_flag = lothraxus_light

		ai_chance = {
			factor = 5
		}
	}	

	option = {

		name = EVTOPTB_WCRAC_1190
		set_character_flag = lothraxus_saved
		remove_trait = creature_lothraxim
		add_trait = creature_nathrezim
		culture = nathrezim
		religion = burning_legion_religion

		ai_chance = {
			factor = .25
			modifier = {
				factor = 2
				trait = proud
			}
			modifier = {
				factor = 2
				trait = stubborn
			}
		}
	}
	immediate = {
		ROOT = {
			character_event = { id = WCRAC.1191 days = 3 }
		}
	}
}
character_event = {
	id = WCRAC.1191
	hide_window = no
	title = EVTTITLE_WCRAC_1191
	is_triggered_only = yes
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Lothraxus_Dragon_Isle	
	desc = EVTDESC_WCRAC_1191

	option = {
	
		name = EVTOPTA_WCRAC_1191
		add_trait = gregarious
		
		ai_chance = {
			factor = 5
		}
	}	

	option = {

		name = EVTOPTB_WCRAC_1191
		add_trait = proud
		ai_chance = {
			factor = 2
			modifier = {
				factor = 2
				trait = proud
			}
		}
	}
	immediate = {
		ROOT = {
			character_event = { id = WCRAC.1192 days = 3 }
		}
	}
}
character_event = {
	id = WCRAC.1192
	hide_window = no
	title = EVTTITLE_WCRAC_1192
	is_triggered_only = yes
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Lothraxus_Dragon_Isle	
	desc = EVTDESC_WCRAC_1192

	option = {
	
		name = EVTOPTA_WCRAC_1192
		add_trait = just
		
		ai_chance = {
			factor = 3
		}
	}	

	option = {

		name = EVTOPTB_WCRAC_1192
		add_trait = kind
		ai_chance = {
			factor = 2
			modifier = {
				factor = 2
			}
		}
	}
	
	option = {

		name = EVTOPTC_WCRAC_1192
		add_trait = cruel
		ai_chance = {
			factor = .25
			modifier = {
				factor = 5
				trait = creature_nathrezim
			}
		}
	}
	immediate = {
		ROOT = {
			character_event = { id = WCRAC.1193 days = 3 }
		}
	}
}
character_event = {
	id = WCRAC.1193
	hide_window = no
	title = EVTTITLE_WCRAC_1193
	is_triggered_only = yes
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Lothraxus_Training_Army	
	desc = EVTDESC_WCRAC_1193

	option = {
	
		name = EVTOPTA_WCRAC_1193
		add_trait = zealous
		add_trait = holy_warrior
		
		ai_chance = {
			factor = 3
		}
	}	

	option = {

		name = EVTOPTB_WCRAC_1193
		add_trait = brave
		add_trait = inspiring_leader
		ai_chance = {
			factor = 2
		}
	}
	
	option = {

		name = EVTOPTC_WCRAC_1193
		add_trait = patient
		add_trait = unyielding_leader
		ai_chance = {
			factor = 2
		}
	}
	option = {

		name = EVTOPTD_WCRAC_1193
		ai_chance = {
			factor = 1
		}
	}

	immediate = {
		ROOT = { set_character_flag = lothraxus_set_up }
	}
}

character_event = {
	id = WCRAC.1194
	hide_window = no
	title = EVTTITLE_WCRAC_1194
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Nathrezim_Confident_Ruler	
	desc = EVTDESC_WCRAC_1194
	has_character_flag = is_lothraxus
	min_age = 18
	max_age = 20
	
	
	trigger = {
		trait = creature_lothraxim
		has_character_flag = lothraxus_light
		has_character_flag = lothraxus_set_up
		is_married = no

		NOR = { has_character_flag = lothraxus_rejected_marriage
			has_character_flag = lothraxus_completed_summons 
		}
	}
		 
	mean_time_to_happen = {
	months = 3
	}
	
	option = {
	
		name = EVTOPTA_WCRAC_1194

		ai_chance = {
			factor = 5
		}
		immediate = {
			ROOT = {
				character_event = { id = WCRAC.1195 days = 2 }
			}
		}

	}	

	option = {

		name = EVTOPTB_WCRAC_1194
		set_character_flag = lothraxus_rejected_marriage

		ai_chance = {
			factor = .25
			modifier = {
				factor = 2
				trait = proud
			}
			modifier = {
				factor = 2
				trait = stubborn
			}
		}
	}
}
character_event = {
	id = WCRAC.1195
	hide_window = no
	title = EVTTITLE_WCRAC_1195
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Lothraxus_Summoning	
	desc = EVTDESC_WCRAC_1195
	is_triggered_only = yes

	option = {
	
		name = EVTOPTA_WCRAC_1195

		ai_chance = {
			factor = 2
		}
		immediate = {
			ROOT = {
				character_event = { id = WCRAC.1196 days = 2 }
			}
		}
	}	

	option = {

		name = EVTOPTB_WCRAC_1195

		ai_chance = {
			factor = 2
		}
		immediate = {
			ROOT = {
				character_event = { id = WCRAC.1197 days = 2 }
			}
		}
	}
	option = {

		name = EVTOPTC_WCRAC_1195

		ai_chance = {
			factor = 2
		}
		immediate = {
			ROOT = {
				character_event = { id = WCRAC.1198 days = 2 }
			}
		}
	}
	option = {

		name = EVTOPTD_WCRAC_1195
		set_character_flag = lothraxus_rejected_marriage

		ai_chance = {
			factor = .25
		}
	}
}
character_event = {
	id = WCRAC.1196
	hide_window = no
	title = EVTTITLE_WCRAC_1196
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Sayaad_Fighting_Mob	
	desc = EVTDESC_WCRAC_1196
	is_triggered_only = yes

	immediate = {
		create_character = {
			age = 18
			name = "Sarielle"
			female = yes
			attributes = { 
				martial = 7
				diplomacy = 8
				stewardship = 8
				intrigue = 9
				learning =  8
			}
			dynasty = none
			employer = ROOT
			religion = ROOT
			culture = lothraxim
			random_traits = no
		}
		new_character = {
			remove_trait = slow
			remove_trait = imbecile
			remove_trait = dull
			remove_trait = feeble
			remove_trait = weak
			add_trait = fair
			add_trait = seductress
			add_trait = lustful
			add_trait = groomed
			add_trait = hedonist
			add_trait = impaler
			add_trait = elusive_shadow
			add_trait = quick
			set_character_flag = is_sarielle
			
			save_event_target_as = lusty_summons
		}
	}
	option = {
	
		name = EVTOPTA_WCRAC_1196

		ai_chance = {
			factor = 5
		}
		event_target:lusty_summons = { prev_add_spouse_this_effect = yes }
		add_lover = event_target:lusty_summons
	}	

	option = {

		name = EVTOPTB_WCRAC_1196

		ai_chance = {
			factor = 2
		}
		add_lover = event_target:lusty_summons
	}
	option = {

		name = EVTOPTC_WCRAC_1196

		ai_chance = {
			factor = 2
		}
	}
	option = {

		name = EVTOPTD_WCRAC_1196
		set_character_flag = lothraxus_rejected_marriage

		add_trait = cruel

		effect = {
			event_target:lusty_summons = { leave_court_and_die_effect = yes }
		}

		ai_chance = {
			factor = .25
		}
	}
	immediate = {
		ROOT = { set_character_flag = lothraxus_completed_summons }
	}
}
character_event = {
	id = WCRAC.1197
	hide_window = no
	title = EVTTITLE_WCRAC_1197
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Sayaad_Fighting_Mob	
	desc = EVTDESC_WCRAC_1197
	is_triggered_only = yes

	immediate = {
		create_character = {
			age = 18
			name = "Sarielle"
			female = yes
			attributes = { 
				martial = 7
				diplomacy = 9
				stewardship = 8
				intrigue = 8
				learning =  8
			}
			dynasty = none
			employer = ROOT
			religion = ROOT
			culture = lothraxim
			random_traits = no
		}
		new_character = {
			remove_trait = slow
			remove_trait = imbecile
			remove_trait = dull
			remove_trait = feeble
			remove_trait = weak
			add_trait = fair
			add_trait = kind
			add_trait = groomed
			add_trait = trusting
			add_trait = patient
			add_trait = gamer
			add_trait = grey_eminence
			add_trait = quick
			add_trait = humble
			add_trait = poet
			add_trait = temperate
			set_character_flag = is_sarielle
			
			save_event_target_as = kind_summons
		}
	}
	option = {
	
		name = EVTOPTA_WCRAC_1197

		ai_chance = {
			factor = 5
		}
		event_target:kind_summons = { prev_add_spouse_this_effect = yes }
		add_friend = event_target:kind_summons
	}	

	option = {

		name = EVTOPTB_WCRAC_1197

		ai_chance = {
			factor = 2
		}
		add_friend = event_target:kind_summons
	}
	option = {

		name = EVTOPTC_WCRAC_1197

		ai_chance = {
			factor = 2
		}
	}
	option = {

		name = EVTOPTD_WCRAC_1197
		set_character_flag = lothraxus_rejected_marriage
		add_trait = cruel

		effect = {
			event_target:kind_summons = { leave_court_and_die_effect = yes }
		}

		ai_chance = {
			factor = .25
		}
	}
	immediate = {
		ROOT = { set_character_flag = lothraxus_completed_summons }
	}
}
character_event = {
	id = WCRAC.1198
	hide_window = no
	title = EVTTITLE_WCRAC_1198
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Sayaad_Fighting_Mob	
	desc = EVTDESC_WCRAC_1198
	is_triggered_only = yes

	immediate = {
		create_character = {
			age = 18
			name = "Sarielle"
			female = yes
			attributes = { 
				martial = 9
				diplomacy = 7
				stewardship = 9
				intrigue = 7
				learning =  8
			}
			dynasty = none
			employer = ROOT
			religion = ROOT
			culture = lothraxim
			random_traits = no
		}
		new_character = {
			remove_trait = slow
			remove_trait = imbecile
			remove_trait = dull
			remove_trait = feeble
			remove_trait = weak
			add_trait = fair
			add_trait = genius
			add_trait = groomed
			add_trait = diligent
			add_trait = proud
			add_trait = organizer
			random_list = { 
				40 = {
					add_trait = administrator
				}
				40 = {
					add_trait = strategist
				}
				20 = {
					add_trait = architect
				}
			}
			random_list = { 
				50 = {
					add_trait = midas_touched
				}
				50 = {
					add_trait = brilliant_strategist
				}
			}
			set_character_flag = is_sarielle
			
			save_event_target_as = smart_summons
		}
	}
	option = {
	
		name = EVTOPTA_WCRAC_1198

		ai_chance = {
			factor = 5
		}
		event_target:smart_summons = { prev_add_spouse_this_effect = yes }
		economy_techpoints = 50
		military_techpoints = 50
	}	

	option = {

		name = EVTOPTB_WCRAC_1198

		ai_chance = {
			factor = 2
		}
		random_list = {
			60 = {
				add_lover = event_target:smart_summons
			}
			40 = {
				add_character_modifier = {
				name = beaten_up
				months = 12
				}
			}
		}
	}
	option = {

		name = EVTOPTC_WCRAC_1198

		ai_chance = {
			factor = 1
		}
	}
	option = {

		name = EVTOPTD_WCRAC_1198
		set_character_flag = lothraxus_rejected_marriage
		add_trait = cruel

		effect = {
			event_target:smart_summons = { leave_court_and_die_effect = yes }
		}

		ai_chance = {
			factor = .25
		}
	}
	immediate = {
		ROOT = { set_character_flag = lothraxus_completed_summons }
	}
}
# Lothraxus and Balnazzar Events
character_event = {
	id = WCRAC.1200
	hide_window = no
	title = EVTTITLE_WCRAC_1200
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Nathrezim_War	
	desc = EVTDESC_WCRAC_1200
	has_character_flag = is_lothraxus

	trigger = {

		has_game_rule = {
				name = lothraxim_balnazzar
				value = on
		}

		trait = creature_lothraxim
		has_character_flag = is_lothraxus
		religion = holy_light
		
		NOT = { has_character_flag = help_balnazzar }
		any_independent_ruler = { has_character_flag = is_balnazzar }
	}

	mean_time_to_happen = { 
		days = 7 
	}

	immediate = {
		set_character_flag = help_balnazzar
	}

	option = {
		name = EVTOPTA_WCRAC_1200
		
		ai_chance = {
			factor = 2
		}

		random_independent_ruler = {
			limit = {
				has_character_flag = is_balnazzar		
			}
			character_event = { id = WCRAC.1201 days = 2 } }
		}
	option = {
		name = EVTOPTB_WCRAC_1200
		
		ai_chance = {
			factor = .25
		}
	}	
}
character_event = {
	id = WCRAC.1201
	hide_window = no
	title = EVTTITLE_WCRAC_1201
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Lothraxion_Fighting
	desc = EVTDESC_WCRAC_1201
	has_character_flag = is_balnazzar
	is_triggered_only = yes

	
	option = {
		name = EVTOPTA_WCRAC_1201

		remove_trait = creature_nathrezim
		add_trait = creature_lothraxim
		culture = lothraxim
		religion = holy_light
	
		
		ROOT = {
			hidden_effect = {
				any_courtier_or_vassal = {
					limit = {
						religion = burning_legion_religion
					}
					religion = holy_light
					abdicate_holy_order_if_religion_changes_effect = yes
				}
				any_courtier_or_vassal = {
					limit = {
						trait = creature_nathrezim
					}
					remove_trait = creature_nathrezim
					add_trait = creature_lothraxim
				}
				any_courtier_or_vassal = {
					limit = {
						trait = creature_sayaadi
					}
					remove_trait = creature_sayaadi
					add_trait = creature_lothraxim
				}
				any_courtier_or_vassal = {
					limit = {
						culture = sayaadi
					}
					culture = lothraxim
				}
				any_courtier_or_vassal = {
					limit = {
						culture = nathrezim
					}
					culture = lothraxim
				}
			}
		}

		FROM = {
			letter_event = {
				id = WCRAC.1202 days = 4
			}
		}
		
		ai_chance = {
			factor = 2
		}
	}
	option = {
		name = EVTOPTB_WCRAC_1201
		
		remove_trait = creature_nathrezim
		add_trait = creature_lothraxim
		culture = lothraxim
		religion = holy_light
		set_secret_religion = burning_legion_religion

		ROOT = {
			hidden_effect = {	
				any_courtier_or_vassal = {
					limit = {
						religion = burning_legion_religion
					}
					religion = holy_light
					abdicate_holy_order_if_religion_changes_effect = yes
				}
				any_courtier_or_vassal = {
					limit = {
						trait = creature_nathrezim
					}
					remove_trait = creature_nathrezim
					add_trait = creature_lothraxim
				}
				any_courtier_or_vassal = {
					limit = {
						trait = creature_sayaadi
					}
					remove_trait = creature_sayaadi
					add_trait = creature_lothraxim
				}
				any_courtier_or_vassal = {
					limit = {
						culture = sayaadi
					}
					culture = lothraxim
				}
				any_courtier_or_vassal = {
					limit = {
						culture = nathrezim
					}
					culture = lothraxim
				}
			}
		}

		FROM = {
			letter_event = {
				id = WCRAC.1202 days = 4
			}
		}

		ai_chance = {
			factor = 3
		}
	}
	option = {
		name = EVTOPTC_WCRAC_1201
		
		FROM = {
			letter_event = {
				id = WCRAC.1203 days = 4
			}
		}
		
		ai_chance = {
			factor = 1
		}
	}		
}
	
letter_event = {
	id = WCRAC.1202
	has_character_flag = is_lothraxus
	
	desc = EVTDESC_WCRAC_1202

	is_triggered_only = yes

	immediate = {
		spawn_unit = {
    			owner = ROOT
    			province = 306 # Solliden
    			home = ROOT
			leader = ROOT
			match_character = ROOT
			match_mult = 1.0
    			attrition = 1.0
    			disband_on_peace = no
    			maintenance_multiplier = 0.5
			reinforces = yes
			reinforce_rate_multiplier = 1.0
		}
		if = {
			limit = {
				ROOT = {
					ai = yes
				}
			}
			FROM = {
				letter_event = {
					id = WCRAC.1210 days = 7
				}
			}	
		}
		else = {
			ROOT = {
				letter_event = {
					id = WCRAC.1210 days = 7
				}
			}
		}
	}

	option = {
		name = EVTOPTA_WCRAC_1202
	
		join_defender_wars = FROM
	}
}

letter_event = {
	id = WCRAC.1203
	has_character_flag = is_lothraxus
	
	desc = EVTDESC_WCRAC_1203

	is_triggered_only = yes

	option = {
		name = EVTOPTA_WCRAC_1203
	}
}
# Lothraxim Diplomacy Events

character_event = {
	id = WCRAC.1210
	hide_window = no
	title = EVTTITLE_WCRAC_1210
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_Nathrezim_War	
	desc = EVTDESC_WCRAC_1210
	only_independent = yes

	trigger = {

		has_game_rule = {
				name = lothraxim_diplomacy
				value = on
		}

		trait = creature_lothraxim
		religion = holy_light
		NOT = { has_character_flag = lothraxim_ally_sought }
		
		any_independent_ruler = { 
			trait = creature_lothraxim
			NOT = { is_allied_with = ROOT 
			}
			NOR = {
				religion = death_god
				religion = orcish_fel
				religion = burning_legion_religion
				religion = old_gods_worship
				religion_group = fel_group
				religion_group = necromancy_group
				religion_group = void_group
				religion = forsaken_cult
				religion = cult_of_hakkar
				religion = helya
			}				
		}
	}

	mean_time_to_happen = { 
		years = 2 
	}

	immediate = {
		set_character_flag = lothraxim_ally_sought 

		random_independent_ruler = {
			limit = {
				trait = creature_lothraxim
				NOT = { is_allied_with = ROOT 
				}
				NOR = {
				religion = death_god
				religion = orcish_fel
				religion = burning_legion_religion
				religion = old_gods_worship
				religion_group = fel_group
				religion_group = necromancy_group
				religion_group = void_group
				religion = forsaken_cult
				religion = cult_of_hakkar
				religion = helya
				}		
			}
		save_event_target_as = potential_ally	
		}	
	}

	option = {
		name = EVTOPTA_WCRAC_1210
		
		event_target:potential_ally = { character_event = { id = WCRAC.1211 days = 4 } }

		ai_chance = {
			factor = 2
		}
	}
	
	option = {
		name = EVTOPTB_WCRAC_1210
		
		ai_chance = {
			factor = 1
		}
	}	
}
letter_event = {
	id = WCRAC.1211
	
	desc = EVTDESC_WCRAC_1211

	is_triggered_only = yes

	option = {
		name = EVTOPTA_WCRAC_1211
	
		add_alliance = {
    			who = FROM
    			years = 25
		}
		FROM = {
			letter_event = {
				id = WCRAC.1212 days = 4
			}
		}
		ai_chance = {
			factor = 2
		}
	}

	option = {
		name = EVTOPTB_WCRAC_1211
	
		FROM = {
			letter_event = {
				id = WCRAC.1213 days = 4
			}
		}
	}
}
letter_event = {
	id = WCRAC.1212
	
	desc = EVTDESC_WCRAC_1212

	is_triggered_only = yes

	option = {
		name = EVTOPTA_WCRAC_1212
	}
}
letter_event = {
	id = WCRAC.1213
	
	desc = EVTDESC_WCRAC_1213

	is_triggered_only = yes

	option = {
		name = EVTOPTA_WCRAC_1213
	}
}

# Clear Lothraxim Sought Ally Flag
character_event = {
	id = WCRAC.1214
	hide_window = yes
	has_character_flag = lothraxim_ally_sought 

	trigger = {
		had_character_flag = {
    			flag = lothraxim_ally_sought 
   			years >= 10
		}
	}

	mean_time_to_happen = { 
		days = 1
	}
		
	immediate = {
		clr_character_flag = lothraxim_ally_sought 
	}
}
	
		