namespace = xgi-opportunities

character_event = {
	id = xgi-opportunities.01
	desc = "You are about to leave your comfort to go out and seek for opportunities."
	picture = "xgi-adventure-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "Go outside to seek opportunities"

		FROM = { 
			random_list = {
		 		17 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.02 days = 5 } }
		 		22 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.03 days = 5 } }
		 		12 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.04 days = 5 } }
		 		9 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.05 days = 5 } }
		 		12 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.12 days = 5 } }
		 		9 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.13 days = 5 } }
		 		1 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.26 days = 5 } }
			}
		}
			
	}

	option = {
	        name = "Automatically go outside each time to seek opportunities"

		trigger={
			ai = no
		}

		FROM = { 
			 character_event = { id = xgi-opportunities.24 }
			 set_character_flag = xgi-Autoutside
		}
			
	}
}

character_event = {
	id = xgi-opportunities.02
	desc = "Congratulations! You have found a pouch full of gold coins. Your adventures this time was not in vain."
	picture = "xgi-gold-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "Sweet..."
		wealth = 80
		remove_trait = travelling
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
			
	}
}

character_event = {
	id = xgi-opportunities.03
	desc = "To bad! You have explored but found nothing. Your adventures this time was in vain."
	picture = "xgi-disappointed-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "Damnit..."
		remove_trait = travelling
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
			
	}
}

character_event = {
	id = xgi-opportunities.04
	desc = "Congratulations! You have found a pill with the efficacy to increase your spiritul energy. Your adventures this time was not in vain."
	picture = "xgi-pill-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "Sweet..."
		FROM = { 
			random_list = {
		 		6 = { piety = 3000 }
		 		5 = { piety = 5000 }
		 		4 = { piety = 6000 }
		 		3 = { piety = 8000 }
		 		2 = { piety = 15000 }
		 		1 = { piety = 30000 }
			}
		}
		remove_trait = travelling
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
			
	}
}

character_event = {
	id = xgi-opportunities.05
	desc = "Warning! You have encountered a powerful spiritual beast. Your adventures this time was dangerous."
	picture = "xgi-encounterbeast-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "Damnit..."
		FROM = { 
			random_list = {
		 		5 = { custom_tooltip = { text = "Avoided the danger" } character_event = { id = xgi-opportunities.06 } }
		 		4 = { custom_tooltip = { text = "Sell the beast materials" } wealth = 95 prestige = 20 character_event = { id = xgi-opportunities.07 } }
		 		4 = { custom_tooltip = { text = "Use the beast core and sell remains" } piety = 9500 wealth = 84 prestige = 20 character_event = { id = xgi-opportunities.08 } }
		 		3 = { add_trait = wounded character_event = { id = xgi-opportunities.09 } }
		 		3 = { add_trait = maimed character_event = { id = xgi-opportunities.10 } }
		 		2 = { add_trait = severely_injured character_event = { id = xgi-opportunities.11 } }
			}
		}
		remove_trait = travelling
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
			
	}
}

character_event = {
	id = xgi-opportunities.06
	desc = "You have evaded the danger and escaped the spiritual beast."
	picture = "xgi-disappointed-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "Sweet..."
			
	}
}

character_event = {
	id = xgi-opportunities.07
	desc = "After a ferocious fight with the spiritual beast, you sold the beast materials."
	picture = "xgi-gold-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "Sweet..."
			
	}
}

character_event = {
	id = xgi-opportunities.08
	desc = "After a ferocious fight with the spiritual beast, you used the beast core for your cultivation and sold the remaining materials."
	picture = "xgi-gold-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "Sweet..."
			
	}
}

character_event = {
	id = xgi-opportunities.09
	desc = "After a ferocious fight with the spiritual beast, you are wounded."
	picture = "xgi-injure-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "Damnit..."
			
	}
}

character_event = {
	id = xgi-opportunities.10
	desc = "After a ferocious fight with the spiritual beast, you are maimed."
	picture = "xgi-injure-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "Damnit..."
			
	}
}

character_event = {
	id = xgi-opportunities.11
	desc = "After a ferocious fight with the spiritual beast, you are severely injured."
	picture = "xgi-injure-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "Damnit..."
			
	}
}

character_event = {
	id = xgi-opportunities.12
	desc = "You entered the cave with the abundance of spiritual energy and cultivated it."
	picture = "xgi-closeddoor-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "Sweet..."
		add_character_modifier = {
			name = xgi-abundance-modifier
			duration = 90
			hidden = no
		}
			
	}
}

character_event = {
	id = xgi-opportunities.13
	desc = "You have accidentally fallen into the hideout of spiritual beasts."
	picture = "xgi-hideoutcave-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "Damnit..."
			random_list = {
		 		6 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.14 } }
		 		6 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.15 } }
		 		6 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.16 } }
		 		5 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.17 } }
		 		5 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.18 } }
		 		5 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.19 } }
		 		4 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.20 } }
		 		4 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.21 } }
		 		4 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.22 } }
			}
	}
}

character_event = {
	id = xgi-opportunities.14
	desc = "You have encountered a spiritual beasts at the level of Qi Gathering Stage."
	picture = "xgi-beasts-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "A mere beast in front of me? Courting death!..."
		trigger = {
			OR = {
				trait = Lv_1_Spiritual_Seed_Shaping_3
				trait = Lv_2_Spiritual_Seed_Nurturing_1
				trait = Lv_2_Spiritual_Seed_Nurturing_2
				trait = Lv_2_Spiritual_Seed_Nurturing_3
				trait = Lv_3_Soul_Germination_1
				trait = Lv_3_Soul_Germination_2
				trait = Lv_3_Soul_Germination_3
				trait = Lv_4_Soul_Perfection_1
				trait = Lv_4_Soul_Perfection_2
				trait = Lv_4_Soul_Perfection_3
				trait = Lv_5_Soul_Unification_1
				trait = Lv_5_Soul_Unification_2
				trait = Lv_5_Soul_Unification_3
				trait = Lv_6_Undying_Body_1
				trait = Lv_6_Undying_Body_2
				trait = Lv_6_Undying_Body_3
				trait = Lv_7_True_Immortal_1
				trait = Lv_7_True_Immortal_2
				trait = Lv_7_True_Immortal_3
				trait = Lv_8_Immortal_God_1
				trait = Lv_8_Immortal_God_2
				trait = Lv_8_Immortal_God_3
				trait = Lv_9_Ancestral_God_1
				trait = Lv_9_Ancestral_God_2
				trait = Lv_9_Ancestral_God_3
			}
		}
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {
		 		4 = { custom_tooltip = { text = "Sell the beast materials" } wealth = 81 prestige = 2 character_event = { id = xgi-opportunities.07 } }
		 		4 = { custom_tooltip = { text = "Use the beast core and sell remains" } piety = 2300 wealth = 60 prestige = 2 character_event = { id = xgi-opportunities.08 } }
			}
		}
		character_event = { id = xgi-opportunities.15 }

	}

	option = {
	        name = "Damnit..."
		trigger = {
			NOT = {
				trait = Lv_1_Spiritual_Seed_Shaping_3
				trait = Lv_2_Spiritual_Seed_Nurturing_1
				trait = Lv_2_Spiritual_Seed_Nurturing_2
				trait = Lv_2_Spiritual_Seed_Nurturing_3
				trait = Lv_3_Soul_Germination_1
				trait = Lv_3_Soul_Germination_2
				trait = Lv_3_Soul_Germination_3
				trait = Lv_4_Soul_Perfection_1
				trait = Lv_4_Soul_Perfection_2
				trait = Lv_4_Soul_Perfection_3
				trait = Lv_5_Soul_Unification_1
				trait = Lv_5_Soul_Unification_2
				trait = Lv_5_Soul_Unification_3
				trait = Lv_6_Undying_Body_1
				trait = Lv_6_Undying_Body_2
				trait = Lv_6_Undying_Body_3
				trait = Lv_7_True_Immortal_1
				trait = Lv_7_True_Immortal_2
				trait = Lv_7_True_Immortal_3
				trait = Lv_8_Immortal_God_1
				trait = Lv_8_Immortal_God_2
				trait = Lv_8_Immortal_God_3
				trait = Lv_9_Ancestral_God_1
				trait = Lv_9_Ancestral_God_2
				trait = Lv_9_Ancestral_God_3
			}
		}
		remove_trait = travelling
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {
		 		3 = { add_trait = wounded character_event = { id = xgi-opportunities.09 } }
		 		3 = { add_trait = maimed character_event = { id = xgi-opportunities.10 } }
		 		2 = { add_trait = severely_injured character_event = { id = xgi-opportunities.11 } }
			}
		}
	}
}

character_event = {
	id = xgi-opportunities.15
	desc = "You have encountered a spiritual beasts at the level of Foundation Building Stage."
	picture = "xgi-beasts-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "A mere beast in front of me? Courting death!..."
		trigger = {
			OR = {
				trait = Lv_2_Spiritual_Seed_Nurturing_3
				trait = Lv_3_Soul_Germination_1
				trait = Lv_3_Soul_Germination_2
				trait = Lv_3_Soul_Germination_3
				trait = Lv_4_Soul_Perfection_1
				trait = Lv_4_Soul_Perfection_2
				trait = Lv_4_Soul_Perfection_3
				trait = Lv_5_Soul_Unification_1
				trait = Lv_5_Soul_Unification_2
				trait = Lv_5_Soul_Unification_3
				trait = Lv_6_Undying_Body_1
				trait = Lv_6_Undying_Body_2
				trait = Lv_6_Undying_Body_3
				trait = Lv_7_True_Immortal_1
				trait = Lv_7_True_Immortal_2
				trait = Lv_7_True_Immortal_3
				trait = Lv_8_Immortal_God_1
				trait = Lv_8_Immortal_God_2
				trait = Lv_8_Immortal_God_3
				trait = Lv_9_Ancestral_God_1
				trait = Lv_9_Ancestral_God_2
				trait = Lv_9_Ancestral_God_3
			}
		}
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {
		 		4 = { custom_tooltip = { text = "Sell the beast materials" } wealth = 81 prestige = 4 character_event = { id = xgi-opportunities.07 } }
		 		4 = { custom_tooltip = { text = "Use the beast core and sell remains" } piety = 2350 wealth = 65 prestige = 4 character_event = { id = xgi-opportunities.08 } }
			}
		}
		character_event = { id = xgi-opportunities.16 }

	}

	option = {
	        name = "Damnit..."
		trigger = {
			NOT = {
				trait = Lv_2_Spiritual_Seed_Nurturing_3
				trait = Lv_3_Soul_Germination_1
				trait = Lv_3_Soul_Germination_2
				trait = Lv_3_Soul_Germination_3
				trait = Lv_4_Soul_Perfection_1
				trait = Lv_4_Soul_Perfection_2
				trait = Lv_4_Soul_Perfection_3
				trait = Lv_5_Soul_Unification_1
				trait = Lv_5_Soul_Unification_2
				trait = Lv_5_Soul_Unification_3
				trait = Lv_6_Undying_Body_1
				trait = Lv_6_Undying_Body_2
				trait = Lv_6_Undying_Body_3
				trait = Lv_7_True_Immortal_1
				trait = Lv_7_True_Immortal_2
				trait = Lv_7_True_Immortal_3
				trait = Lv_8_Immortal_God_1
				trait = Lv_8_Immortal_God_2
				trait = Lv_8_Immortal_God_3
				trait = Lv_9_Ancestral_God_1
				trait = Lv_9_Ancestral_God_2
				trait = Lv_9_Ancestral_God_3
			}
		}
		remove_trait = travelling
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {
		 		3 = { add_trait = wounded character_event = { id = xgi-opportunities.09 } }
		 		3 = { add_trait = maimed character_event = { id = xgi-opportunities.10 } }
		 		2 = { add_trait = severely_injured character_event = { id = xgi-opportunities.11 } }
			}
		}
	}
}

character_event = {
	id = xgi-opportunities.16
	desc = "You have encountered a spiritual beasts at the level of Golden Core Stage."
	picture = "xgi-beasts-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "A mere beast in front of me? Courting death!..."
		trigger = {
			OR = {
				trait = Lv_3_Soul_Germination_3
				trait = Lv_4_Soul_Perfection_1
				trait = Lv_4_Soul_Perfection_2
				trait = Lv_4_Soul_Perfection_3
				trait = Lv_5_Soul_Unification_1
				trait = Lv_5_Soul_Unification_2
				trait = Lv_5_Soul_Unification_3
				trait = Lv_6_Undying_Body_1
				trait = Lv_6_Undying_Body_2
				trait = Lv_6_Undying_Body_3
				trait = Lv_7_True_Immortal_1
				trait = Lv_7_True_Immortal_2
				trait = Lv_7_True_Immortal_3
				trait = Lv_8_Immortal_God_1
				trait = Lv_8_Immortal_God_2
				trait = Lv_8_Immortal_God_3
				trait = Lv_9_Ancestral_God_1
				trait = Lv_9_Ancestral_God_2
				trait = Lv_9_Ancestral_God_3
			}
		}
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {
		 		4 = { custom_tooltip = { text = "Sell the beast materials" } wealth = 82 prestige = 6 character_event = { id = xgi-opportunities.07 } }
		 		4 = { custom_tooltip = { text = "Use the beast core and sell remains" } piety = 2390 wealth = 80 prestige = 6 character_event = { id = xgi-opportunities.08 } }
			}
		}
		character_event = { id = xgi-opportunities.17 }

	}

	option = {
	        name = "Damnit..."
		trigger = {
			NOT = {
				trait = Lv_3_Soul_Germination_3
				trait = Lv_4_Soul_Perfection_1
				trait = Lv_4_Soul_Perfection_2
				trait = Lv_4_Soul_Perfection_3
				trait = Lv_5_Soul_Unification_1
				trait = Lv_5_Soul_Unification_2
				trait = Lv_5_Soul_Unification_3
				trait = Lv_6_Undying_Body_1
				trait = Lv_6_Undying_Body_2
				trait = Lv_6_Undying_Body_3
				trait = Lv_7_True_Immortal_1
				trait = Lv_7_True_Immortal_2
				trait = Lv_7_True_Immortal_3
				trait = Lv_8_Immortal_God_1
				trait = Lv_8_Immortal_God_2
				trait = Lv_8_Immortal_God_3
				trait = Lv_9_Ancestral_God_1
				trait = Lv_9_Ancestral_God_2
				trait = Lv_9_Ancestral_God_3
			}
		}
		remove_trait = travelling
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {
		 		3 = { add_trait = wounded character_event = { id = xgi-opportunities.09 } }
		 		3 = { add_trait = maimed character_event = { id = xgi-opportunities.10 } }
		 		2 = { add_trait = severely_injured character_event = { id = xgi-opportunities.11 } }
			}
		}
	}
}

character_event = {
	id = xgi-opportunities.17
	desc = "You have encountered a spiritual beasts at the level of Nascent Soul Stage."
	picture = "xgi-beasts-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "A mere beast in front of me? Courting death!..."
		trigger = {
			OR = {
				trait = Lv_4_Soul_Perfection_3
				trait = Lv_5_Soul_Unification_1
				trait = Lv_5_Soul_Unification_2
				trait = Lv_5_Soul_Unification_3
				trait = Lv_6_Undying_Body_1
				trait = Lv_6_Undying_Body_2
				trait = Lv_6_Undying_Body_3
				trait = Lv_7_True_Immortal_1
				trait = Lv_7_True_Immortal_2
				trait = Lv_7_True_Immortal_3
				trait = Lv_8_Immortal_God_1
				trait = Lv_8_Immortal_God_2
				trait = Lv_8_Immortal_God_3
				trait = Lv_9_Ancestral_God_1
				trait = Lv_9_Ancestral_God_2
				trait = Lv_9_Ancestral_God_3
			}
		}
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {
		 		4 = { custom_tooltip = { text = "Sell the beast materials" } wealth = 82 prestige = 8 character_event = { id = xgi-opportunities.07 } }
		 		4 = { custom_tooltip = { text = "Use the beast core and sell remains" } piety = 2420 wealth = 62 prestige = 8 character_event = { id = xgi-opportunities.08 } }
			}
		}
		character_event = { id = xgi-opportunities.18 }

	}

	option = {
	        name = "Damnit..."
		trigger = {
			NOT = {
				trait = Lv_4_Soul_Perfection_3
				trait = Lv_5_Soul_Unification_1
				trait = Lv_5_Soul_Unification_2
				trait = Lv_5_Soul_Unification_3
				trait = Lv_6_Undying_Body_1
				trait = Lv_6_Undying_Body_2
				trait = Lv_6_Undying_Body_3
				trait = Lv_7_True_Immortal_1
				trait = Lv_7_True_Immortal_2
				trait = Lv_7_True_Immortal_3
				trait = Lv_8_Immortal_God_1
				trait = Lv_8_Immortal_God_2
				trait = Lv_8_Immortal_God_3
				trait = Lv_9_Ancestral_God_1
				trait = Lv_9_Ancestral_God_2
				trait = Lv_9_Ancestral_God_3
			}
		}
		remove_trait = travelling
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {
		 		3 = { add_trait = wounded character_event = { id = xgi-opportunities.09 } }
		 		3 = { add_trait = maimed character_event = { id = xgi-opportunities.10 } }
		 		2 = { add_trait = severely_injured character_event = { id = xgi-opportunities.11 } }
			}
		}
	}
}

character_event = {
	id = xgi-opportunities.18
	desc = "You have encountered a spiritual beasts at the level of Soul Transformation Stage."
	picture = "xgi-beasts-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "A mere beast in front of me? Courting death!..."
		trigger = {
			OR = {
				trait = Lv_5_Soul_Unification_3
				trait = Lv_6_Undying_Body_1
				trait = Lv_6_Undying_Body_2
				trait = Lv_6_Undying_Body_3
				trait = Lv_7_True_Immortal_1
				trait = Lv_7_True_Immortal_2
				trait = Lv_7_True_Immortal_3
				trait = Lv_8_Immortal_God_1
				trait = Lv_8_Immortal_God_2
				trait = Lv_8_Immortal_God_3
				trait = Lv_9_Ancestral_God_1
				trait = Lv_9_Ancestral_God_2
				trait = Lv_9_Ancestral_God_3
			}
		}
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {
		 		4 = { custom_tooltip = { text = "Sell the beast materials" } wealth = 82 prestige = 10 character_event = { id = xgi-opportunities.07 } }
		 		4 = { custom_tooltip = { text = "Use the beast core and sell remains" } piety = 2440 wealth = 64 prestige = 10 character_event = { id = xgi-opportunities.08 } }
			}
		}
		character_event = { id = xgi-opportunities.19 }

	}

	option = {
	        name = "Damnit..."
		trigger = {
			NOT = {
				trait = Lv_5_Soul_Unification_3
				trait = Lv_6_Undying_Body_1
				trait = Lv_6_Undying_Body_2
				trait = Lv_6_Undying_Body_3
				trait = Lv_7_True_Immortal_1
				trait = Lv_7_True_Immortal_2
				trait = Lv_7_True_Immortal_3
				trait = Lv_8_Immortal_God_1
				trait = Lv_8_Immortal_God_2
				trait = Lv_8_Immortal_God_3
				trait = Lv_9_Ancestral_God_1
				trait = Lv_9_Ancestral_God_2
				trait = Lv_9_Ancestral_God_3
			}
		}
		remove_trait = travelling
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {
		 		3 = { add_trait = wounded character_event = { id = xgi-opportunities.09 } }
		 		3 = { add_trait = maimed character_event = { id = xgi-opportunities.10 } }
		 		2 = { add_trait = severely_injured character_event = { id = xgi-opportunities.11 } }
			}
		}
	}
}

character_event = {
	id = xgi-opportunities.19
	desc = "You have encountered a spiritual beasts at the level of Enlightenment Stage."
	picture = "xgi-beasts-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "A mere beast in front of me? Courting death!..."
		trigger = {
			OR = {
				trait = Lv_6_Undying_Body_3
				trait = Lv_7_True_Immortal_1
				trait = Lv_7_True_Immortal_2
				trait = Lv_7_True_Immortal_3
				trait = Lv_8_Immortal_God_1
				trait = Lv_8_Immortal_God_2
				trait = Lv_8_Immortal_God_3
				trait = Lv_9_Ancestral_God_1
				trait = Lv_9_Ancestral_God_2
				trait = Lv_9_Ancestral_God_3
			}
		}
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {
		 		4 = { custom_tooltip = { text = "Sell the beast materials" } wealth = 83 prestige = 12 character_event = { id = xgi-opportunities.07 } }
		 		4 = { custom_tooltip = { text = "Use the beast core and sell remains" } piety = 2460 wealth = 66 prestige = 12 character_event = { id = xgi-opportunities.08 } }
			}
		}
		character_event = { id = xgi-opportunities.20 }

	}

	option = {
	        name = "Damnit..."
		trigger = {
			NOT = {
				trait = Lv_6_Undying_Body_3
				trait = Lv_7_True_Immortal_1
				trait = Lv_7_True_Immortal_2
				trait = Lv_7_True_Immortal_3
				trait = Lv_8_Immortal_God_1
				trait = Lv_8_Immortal_God_2
				trait = Lv_8_Immortal_God_3
				trait = Lv_9_Ancestral_God_1
				trait = Lv_9_Ancestral_God_2
				trait = Lv_9_Ancestral_God_3
			}
		}
		remove_trait = travelling
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {
		 		3 = { add_trait = wounded character_event = { id = xgi-opportunities.09 } }
		 		3 = { add_trait = maimed character_event = { id = xgi-opportunities.10 } }
		 		2 = { add_trait = severely_injured character_event = { id = xgi-opportunities.11 } }
			}
		}
	}
}

character_event = {
	id = xgi-opportunities.20
	desc = "You have encountered a spiritual beasts at the level of Divine Immortal Stage."
	picture = "xgi-beasts-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "A mere beast in front of me? Courting death!..."
		trigger = {
			OR = {
				trait = Lv_7_True_Immortal_3
				trait = Lv_8_Immortal_God_1
				trait = Lv_8_Immortal_God_2
				trait = Lv_8_Immortal_God_3
				trait = Lv_9_Ancestral_God_1
				trait = Lv_9_Ancestral_God_2
				trait = Lv_9_Ancestral_God_3
			}
		}
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {
		 		4 = { custom_tooltip = { text = "Sell the beast materials" } wealth = 83 prestige = 14 character_event = { id = xgi-opportunities.07 } }
		 		4 = { custom_tooltip = { text = "Use the beast core and sell remains" } piety = 2480 wealth = 68 prestige = 14 character_event = { id = xgi-opportunities.08 } }
			}
		}
		character_event = { id = xgi-opportunities.21 }

	}

	option = {
	        name = "Damnit..."
		trigger = {
			NOT = {
				trait = Lv_7_True_Immortal_3
				trait = Lv_8_Immortal_God_1
				trait = Lv_8_Immortal_God_2
				trait = Lv_8_Immortal_God_3
				trait = Lv_9_Ancestral_God_1
				trait = Lv_9_Ancestral_God_2
				trait = Lv_9_Ancestral_God_3
			}
		}
		remove_trait = travelling
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {
		 		3 = { add_trait = wounded character_event = { id = xgi-opportunities.09 } }
		 		3 = { add_trait = maimed character_event = { id = xgi-opportunities.10 } }
		 		2 = { add_trait = severely_injured character_event = { id = xgi-opportunities.11 } }
			}
		}
	}
}

character_event = {
	id = xgi-opportunities.21
	desc = "You have encountered a spiritual beasts at the level of Immortal God Stage."
	picture = "xgi-beasts-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "A mere beast in front of me? Courting death!..."
		trigger = {
			OR = {
				trait = Lv_8_Immortal_God_3
				trait = Lv_9_Ancestral_God_1
				trait = Lv_9_Ancestral_God_2
				trait = Lv_9_Ancestral_God_3
			}
		}
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {
		 		4 = { custom_tooltip = { text = "Sell the beast materials" } wealth = 83 prestige = 16 character_event = { id = xgi-opportunities.07 } }
		 		4 = { custom_tooltip = { text = "Use the beast core and sell remains" } piety = 2500 wealth = 80 prestige = 16 character_event = { id = xgi-opportunities.08 } }
			}
		}
		character_event = { id = xgi-opportunities.22 }

	}

	option = {
	        name = "Damnit..."
		trigger = {
			NOT = {
				trait = Lv_8_Immortal_God_3
				trait = Lv_9_Ancestral_God_1
				trait = Lv_9_Ancestral_God_2
				trait = Lv_9_Ancestral_God_3
			}
		}
		remove_trait = travelling
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {
		 		3 = { add_trait = wounded character_event = { id = xgi-opportunities.09 } }
		 		3 = { add_trait = maimed character_event = { id = xgi-opportunities.10 } }
		 		2 = { add_trait = severely_injured character_event = { id = xgi-opportunities.11 } }
			}
		}
	}
}

character_event = {
	id = xgi-opportunities.22
	desc = "You have encountered a spiritual beasts at the level of Ancestral God Stage."
	picture = "xgi-beasts-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "A mere beast in front of me? Courting death!..."
		trigger = {
			OR = {
				trait = Lv_9_Ancestral_God_3
			}
		}
		remove_trait = travelling
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {
		 		4 = { custom_tooltip = { text = "Sell the beast materials" } wealth = 84 prestige = 20 character_event = { id = xgi-opportunities.07 } }
		 		4 = { custom_tooltip = { text = "Use the beast core and sell remains" } piety = 2550 wealth = 82 prestige = 20 character_event = { id = xgi-opportunities.08 } }
		 		3 = { add_trait = wounded character_event = { id = xgi-opportunities.09 } }
		 		3 = { add_trait = maimed character_event = { id = xgi-opportunities.10 } }
		 		2 = { add_trait = severely_injured character_event = { id = xgi-opportunities.11 } }
			}
		}

	}

	option = {
	        name = "Damnit..."
		trigger = {
			NOT = {
				trait = Lv_9_Ancestral_God_3
			}
		}
		remove_trait = travelling
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {
		 		3 = { add_trait = wounded character_event = { id = xgi-opportunities.09 } }
		 		3 = { add_trait = maimed character_event = { id = xgi-opportunities.10 } }
		 		2 = { add_trait = severely_injured character_event = { id = xgi-opportunities.11 } }
			}
		}
	}
}

character_event = {
	id = xgi-opportunities.23
	desc = "You have entered a secret cave and found the inheritance left by a powerful expert."
	picture = "xgi-hideoutcave-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	option = {
	        name = "I've already inherited the best legacy. I will take the loot."

		trigger={
			has_character_modifier = xgi-Inheritence-modifier
		}

		prestige = 300
		wealth = 100
		piety = 50000
	}

	option = {
	        name = "My trip was not in vain.(There's a chance of downgrading)"

		trigger={
			NOT = { has_character_modifier = xgi-Inheritence-modifier }
		}

		remove_trait = travelling
		add_character_modifier = {
			name = xgi-recentlyadventured-modifier
			duration = 546
			hidden = no
		}
		FROM = { 
			random_list = {

		 		12 = { 
					prestige = 100
					wealth = 20
					piety = 10000

					add_character_modifier = {
						name = xgi-Inheritence-modifier5
						duration = -1
						hidden = no
					}
					remove_character_modifier = xgi-Inheritence-modifier4
					remove_character_modifier = xgi-Inheritence-modifier3
					remove_character_modifier = xgi-Inheritence-modifier2
				}

		 		9 = { 
					prestige = 200
					wealth = 100
					piety = 15000

					add_character_modifier = {
						name = xgi-Inheritence-modifier4
						duration = -1
						hidden = no
					}
					remove_character_modifier = xgi-Inheritence-modifier5
					remove_character_modifier = xgi-Inheritence-modifier3
					remove_character_modifier = xgi-Inheritence-modifier2
				}

		 		6 = { 
					prestige = 300
					wealth = 200
					piety = 20000

					add_character_modifier = {
						name = xgi-Inheritence-modifier3
						duration = -1
						hidden = no
					}
					remove_character_modifier = xgi-Inheritence-modifier5
					remove_character_modifier = xgi-Inheritence-modifier4
					remove_character_modifier = xgi-Inheritence-modifier2
				}

		 		3 = { 
					add_trait = xgi-Divine_potential
					prestige = 400
					wealth = 400
					piety = 30000

					add_character_modifier = {
						name = xgi-Inheritence-modifier2
						duration = -1
						hidden = no
					}
					remove_character_modifier = xgi-Inheritence-modifier5
					remove_character_modifier = xgi-Inheritence-modifier4
					remove_character_modifier = xgi-Inheritence-modifier3
				}

		 		1 = { 
					add_trait = xgi-Divine_potential
					prestige = 500
					wealth = 700
					piety = 50000

					add_character_modifier = {
						name = xgi-Inheritence-modifier
						duration = -1
						hidden = no
					}
					remove_character_modifier = xgi-Inheritence-modifier5
					remove_character_modifier = xgi-Inheritence-modifier4
					remove_character_modifier = xgi-Inheritence-modifier3
					remove_character_modifier = xgi-Inheritence-modifier2
				}

			}
		}
	}
}

character_event = {
	id = xgi-opportunities.24
	hide_window = yes
	is_triggered_only = no

	mean_time_to_happen = {
		days = 7
	}

	trigger = {
		ai = no
		wealth = 20
		has_character_flag = xgi-Autoutside
		NOT = { has_character_modifier = xgi-recentlyadventured2-modifier }
			NOT = {
				is_ill = yes
				trait = wounded
				trait = maimed
				trait = incapable
				trait = severely_injured
				has_character_modifier = bedridden_illness
			}
	}

	immediate = {
		add_trait = travelling
		add_character_modifier = {
			name = xgi-recentlyadventured2-modifier
			duration = 540
			hidden = no
		} 
			wealth = -5
			piety = -50

			random_list = {
		 		17 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.02 days = 5 } }
		 		22 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.03 days = 5 } }
		 		12 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.04 days = 5 } }
		 		9 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.05 days = 5 } }
		 		12 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.12 days = 5 } }
		 		9 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.13 days = 5 } }
		 		1 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.23 days = 5 } }
			}
			
	}
}

character_event = {
	id = xgi-opportunities.25
	desc = "The Primordial God Emperor's Tomb is opened and cultivators are going out in numbers to seek opportunities."
	picture = "xgi-tomb-event"
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 2
	}

	trigger = {
			NOT = { has_character_modifier = xgi-stopventuring-modifier }
			OR = {
				ai = no
			}
	}

	option = {
	        name = "Go and compete(Might take a while to load.)"
		clr_character_flag = xgi-opentomb 

		IF = { 
				limit = {

					OR = {
						ai = no
					}
					OR = {
						trait = Lv_1_Spiritual_Seed_Shaping_1
						trait = Lv_1_Spiritual_Seed_Shaping_2
						trait = Lv_1_Spiritual_Seed_Shaping_3
						trait = Lv_2_Spiritual_Seed_Nurturing_1
						trait = Lv_2_Spiritual_Seed_Nurturing_2
						trait = Lv_2_Spiritual_Seed_Nurturing_3
						trait = Lv_3_Soul_Germination_1
						trait = Lv_3_Soul_Germination_2
						trait = Lv_3_Soul_Germination_3
						trait = Lv_4_Soul_Perfection_1
						trait = Lv_4_Soul_Perfection_2
						trait = Lv_4_Soul_Perfection_3
						trait = Lv_5_Soul_Unification_1
						trait = Lv_5_Soul_Unification_2
						trait = Lv_5_Soul_Unification_3
						trait = Lv_6_Undying_Body_1
						trait = Lv_6_Undying_Body_2
						trait = Lv_6_Undying_Body_3
						trait = Lv_7_True_Immortal_1
						trait = Lv_7_True_Immortal_2
						trait = Lv_7_True_Immortal_3
						trait = Lv_8_Immortal_God_1
						trait = Lv_8_Immortal_God_2
						trait = Lv_8_Immortal_God_3
						trait = Lv_9_Ancestral_God_1
						trait = Lv_9_Ancestral_God_2
						trait = Lv_9_Ancestral_God_3
					}
 				}

				add_trait = travelling
				add_character_modifier = {
					name = xgi-recentlyadventured-modifier
					duration = 546
					hidden = no
				}
				wealth = -5
				piety = -80 
				ROOT = {
					random_list = {
		 				22 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.03 days = 3 } }
		 				95 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.02 days = 3 } character_event = { id = xgi-opportunities.04 days = 4 } character_event = { id = xgi-opportunities.12 days = 5 } character_event = { id = xgi-opportunities.02 days = 6 } }
		 				85 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.12 days = 3 } character_event = { id = xgi-opportunities.02 days = 4 } character_event = { id = xgi-opportunities.13 days = 5 } }
		 				1 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.27 days = 3 } character_event = { id = xgi-opportunities.02 days = 3 } character_event = { id = xgi-opportunities.04 days = 4 } character_event = { id = xgi-opportunities.12 days = 5 } character_event = { id = xgi-opportunities.02 days = 6 } }
					}
				}
		}
			any_character = {
				limit = {
					ai = yes
					OR = {
						trait = Lv_1_Spiritual_Seed_Shaping_1
						trait = Lv_1_Spiritual_Seed_Shaping_2
						trait = Lv_1_Spiritual_Seed_Shaping_3
						trait = Lv_2_Spiritual_Seed_Nurturing_1
						trait = Lv_2_Spiritual_Seed_Nurturing_2
						trait = Lv_2_Spiritual_Seed_Nurturing_3
						trait = Lv_3_Soul_Germination_1
						trait = Lv_3_Soul_Germination_2
						trait = Lv_3_Soul_Germination_3
						trait = Lv_4_Soul_Perfection_1
						trait = Lv_4_Soul_Perfection_2
						trait = Lv_4_Soul_Perfection_3
						trait = Lv_5_Soul_Unification_1
						trait = Lv_5_Soul_Unification_2
						trait = Lv_5_Soul_Unification_3
						trait = Lv_6_Undying_Body_1
						trait = Lv_6_Undying_Body_2
						trait = Lv_6_Undying_Body_3
						trait = Lv_7_True_Immortal_1
						trait = Lv_7_True_Immortal_2
						trait = Lv_7_True_Immortal_3
						trait = Lv_8_Immortal_God_1
						trait = Lv_8_Immortal_God_2
						trait = Lv_8_Immortal_God_3
						trait = Lv_9_Ancestral_God_1
						trait = Lv_9_Ancestral_God_2
						trait = Lv_9_Ancestral_God_3
					}

				}
				character_event = { id = xgi-opportunities.28 }
			}
			
	}

	option = {
	        name = "Not interested(Might take a while to load.)"
		clr_character_flag = xgi-opentomb
				add_character_modifier = {
					name = xgi-recentlyadventured-modifier
					duration = 546
					hidden = no
				}

		trigger={
			ai = no
			is_ruler = yes
		}

			any_character = {
				limit = {
					ai = yes
					OR = {
						trait = Lv_1_Spiritual_Seed_Shaping_1
						trait = Lv_1_Spiritual_Seed_Shaping_2
						trait = Lv_1_Spiritual_Seed_Shaping_3
						trait = Lv_2_Spiritual_Seed_Nurturing_1
						trait = Lv_2_Spiritual_Seed_Nurturing_2
						trait = Lv_2_Spiritual_Seed_Nurturing_3
						trait = Lv_3_Soul_Germination_1
						trait = Lv_3_Soul_Germination_2
						trait = Lv_3_Soul_Germination_3
						trait = Lv_4_Soul_Perfection_1
						trait = Lv_4_Soul_Perfection_2
						trait = Lv_4_Soul_Perfection_3
						trait = Lv_5_Soul_Unification_1
						trait = Lv_5_Soul_Unification_2
						trait = Lv_5_Soul_Unification_3
						trait = Lv_6_Undying_Body_1
						trait = Lv_6_Undying_Body_2
						trait = Lv_6_Undying_Body_3
						trait = Lv_7_True_Immortal_1
						trait = Lv_7_True_Immortal_2
						trait = Lv_7_True_Immortal_3
						trait = Lv_8_Immortal_God_1
						trait = Lv_8_Immortal_God_2
						trait = Lv_8_Immortal_God_3
						trait = Lv_9_Ancestral_God_1
						trait = Lv_9_Ancestral_God_2
						trait = Lv_9_Ancestral_God_3
					}

				}
				character_event = { id = xgi-opportunities.28 }
			}
			
	}

}

character_event = {
	id = xgi-opportunities.26
	hide_window = yes
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	immediate = {
	        name = "Go outside to seek opportunities"

		FROM = { 
			random_list = {
		 		9 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.02 days = 5 } }
		 		9 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.03 days = 5 } }
		 		9 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.04 days = 5 } }
		 		9 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.05 days = 5 } }
		 		9 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.12 days = 5 } }
		 		9 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.13 days = 5 } }
		 		9 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.27 days = 5 } }
			}
		}
			
	}

}

character_event = {
	id = xgi-opportunities.27
	hide_window = yes
	is_triggered_only = yes

	mean_time_to_happen = {
		days = 6
	}

	immediate = {
	        name = "Go outside to seek opportunities"

		FROM = { 
			random_list = {
		 		8 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.02 days = 5 } }
		 		8 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.04 days = 5 } }
		 		8 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.12 days = 5 } }
		 		8 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.23 days = 5 } }
			}
		}
			
	}

}

character_event = { #NPC
	id = xgi-opportunities.28
	hide_window = yes
	is_triggered_only = yes

	trigger = {
			NOT = { has_character_modifier = xgi-stopventuring-modifier }
			NOT = { has_character_flag = xgi-_closed_door_cultivation }
			ai = yes

					OR = {
						trait = Lv_1_Spiritual_Seed_Shaping_1
						trait = Lv_1_Spiritual_Seed_Shaping_2
						trait = Lv_1_Spiritual_Seed_Shaping_3
						trait = Lv_2_Spiritual_Seed_Nurturing_1
						trait = Lv_2_Spiritual_Seed_Nurturing_2
						trait = Lv_2_Spiritual_Seed_Nurturing_3
						trait = Lv_3_Soul_Germination_1
						trait = Lv_3_Soul_Germination_2
						trait = Lv_3_Soul_Germination_3
						trait = Lv_4_Soul_Perfection_1
						trait = Lv_4_Soul_Perfection_2
						trait = Lv_4_Soul_Perfection_3
						trait = Lv_5_Soul_Unification_1
						trait = Lv_5_Soul_Unification_2
						trait = Lv_5_Soul_Unification_3
						trait = Lv_6_Undying_Body_1
						trait = Lv_6_Undying_Body_2
						trait = Lv_6_Undying_Body_3
						trait = Lv_7_True_Immortal_1
						trait = Lv_7_True_Immortal_2
						trait = Lv_7_True_Immortal_3
						trait = Lv_8_Immortal_God_1
						trait = Lv_8_Immortal_God_2
						trait = Lv_8_Immortal_God_3
						trait = Lv_9_Ancestral_God_1
						trait = Lv_9_Ancestral_God_2
						trait = Lv_9_Ancestral_God_3
					}
	}

	immediate = {
					add_trait = travelling
					add_character_modifier = {
						name = xgi-recentlyadventured-modifier
						duration = 546
						hidden = no
					}
					wealth = -5
					piety = -80 
					ROOT = {
						random_list = {
		 					22 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.03 days = 3 } }
		 					22 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.03 days = 3 } }
		 					95 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.02 days = 3 } character_event = { id = xgi-opportunities.04 days = 4 } character_event = { id = xgi-opportunities.12 days = 5 } character_event = { id = xgi-opportunities.02 days = 6 } }
		 					85 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.12 days = 3 } character_event = { id = xgi-opportunities.02 days = 4 } character_event = { id = xgi-opportunities.13 days = 5 } }
		 					1 = { custom_tooltip = { text = "Random encounter" } character_event = { id = xgi-opportunities.27 days = 3 } character_event = { id = xgi-opportunities.02 days = 3 } character_event = { id = xgi-opportunities.04 days = 4 } character_event = { id = xgi-opportunities.12 days = 5 } character_event = { id = xgi-opportunities.02 days = 6 } }
						}
					}
			
	}

}
