
targetted_decisions = {

	xgi-BuyNascentSoul = {

		is_high_prio = yes
		ai = no

		from_potential = {
			age = 4

		}

		potential = {
			ai = yes
			OR = {
				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
			}
				NOT = {
					has_character_flag = xgi-soulperfectionpill
				}
		}

		allow = {
			FROM { wealth = 2000 }
			OR = {
				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
			}
		}

		effect = {
			FROM { wealth = -2000 }
			set_character_flag = xgi-soulperfectionpill
			piety = 1000
			FROM { character_event = { id = xgi-goldshare.007 } }
				opinion = {
					modifier = xgi-love
					who = FROM
				} 
		}

		ai_will_do = {
		  factor = 1
		}
	}

	xgi-Buyheavenavoidingpill = {

		is_high_prio = yes
		ai = no

		from_potential = {
			age = 4

		}

		potential = {
			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
			}
				NOT = {
					has_character_modifier = xgi-heavenavoidingpill
				}
		}

		allow = {
			FROM { wealth = 7800 }
				NOT = {
					has_character_modifier = xgi-heavenavoidingpill
				}
		}

		effect = {
			FROM { wealth = -7800 }
			add_character_modifier = {
				name = xgi-heavenavoidingpill
				duration = -1
				hidden = no
			}
				opinion = {
					modifier = xgi-love
					who = FROM
				} 
		}

		ai_will_do = {
		  factor = 1
		}
	}

	xgi-Send-Gift = {

		is_high_prio = yes
		ai = no

		from_potential = {
			age = 4
		}

		potential = {
			ai = yes
			age = 4
		}

		allow = {
			age = 4
			FROM { wealth = 500 }
			NOT = {
				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
			}
		}

		effect = {
			FROM { wealth = -500 }
			ROOT { wealth = 500 }
			opinion = {
				modifier = xgi-love
				who = FROM
			}

		}

		ai_will_do = {
			factor = 0.6

		}
	}

	xgi-cut-from-funding = {
		is_high_prio = yes
		ai = yes

		from_potential = {
			age = 2
		}

		potential = {
			OR = {
				is_child_of = FROM
				is_married = FROM
				any_spouse = { character = FROM }
				is_lover = FROM
				ROOT = {
					has_character_modifier = xgi-clanmember-modifier
					dynasty = FROM
				}
			}
			NOT = { has_character_flag = xgi-NotFunding }
		}
		allow = {
			OR = {
				ROOT = {
					trait = xgi-Trash_potential 
				}
				FROM = { NOT = { opinion = { who = ROOT value = 15 } } }
			}
		}

		effect = {
				set_character_flag = xgi-NotFunding
				opinion = {
					modifier = xgi-hate
					who = FROM
				}

		}
		ai_will_do = {
			factor = 1

			modifier = {
				factor = 2
				trait = proud
			}
			modifier = {
				factor = 2
				trait = ambitious
			}

		}
	}

	xgi-Restore-funding = {
		is_high_prio = yes
		ai = yes

		from_potential = {
			age = 2
		}

		potential = {
			OR = {
				is_child_of = FROM
				is_married = FROM
				any_spouse = { character = FROM }
				is_lover = FROM
				ROOT = {
					has_character_modifier = xgi-clanmember-modifier
					dynasty = FROM
				}
			}
			OR = { has_character_flag = xgi-NotFunding }
		}
		allow = {
			NOT = { trait = xgi-Trash_potential }
			FROM = { opinion = { who = ROOT value = 15 } }
		}

		effect = {
				clr_character_flag = xgi-NotFunding
				opinion = {
					modifier = xgi-love
					who = FROM
				}

		}
		ai_will_do = {
			factor = 0.6

		}
	}
}