﻿nine_divines_decision = {
	picture = { reference = "gfx/interface/illustrations/decisions/nine_divines.dds" }
	ai_check_interval = 120
	desc = nine_divines_decision_desc
	decision_group_type = major
	
	is_shown = {
		is_ai = no
		is_landed = yes
		is_independent_ruler = yes
		piety_level >= max_piety_level
		prestige_level >= max_prestige_level
		faith = {
			OR = { #is available to faiths that worship the Divines or are otherwise part of the Divines religious sphere
				has_doctrine = doctrine_pantheon_divines
				has_doctrine = doctrine_pantheon_nord
				has_doctrine = doctrine_pantheon_breton
				has_doctrine = doctrine_pantheon_redguard
				has_doctrine = doctrine_pantheon_nedic_aedra
				has_doctrine = special_doctrine_cyrodiilic_cult
				has_doctrine = special_doctrine_bretic_traditions
			}
		}
		highest_held_title_tier >= tier_empire
		NOR = {
			has_title = title:e_colovian_estates
			has_title = title:e_nibenay
			has_title = title:e_eastern_skyrim
			has_title = title:e_western_skyrim
		}
		has_trait = dragonborn
		any_character_artifact = {
			has_artifact_modifier = aok_modifier
		}
		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:nine_divines_decision
			}
		}
	}

	is_valid = {
		calc_true_if = {
			amount >= 8
			OR = {
				AND = {
					piety_level >= max_piety_level
					prestige_level >= max_prestige_level
					legitimacy_level >= 5
				}
				AND = {
					piety_level >= max_piety_level
					prestige_level >= max_prestige_level
					influence_level >= 5
				}
			}
			AND = {
				dynasty = { has_dynasty_perk = dragonblood_legacy_5 }
				dynasty_prestige_level >= 5
			}
			AND = {
				highest_held_title_tier >= tier_empire
				sub_realm_size >= 600
				OR = {
					has_realm_law = imperial_bureaucracy_3
					has_realm_law = crown_authority_3
				}
			}
			custom_tooltip = {
				text = db_restored_dragon_fires_ceremony
				is_target_in_global_variable_list = {
					name = mundus_barrier_switch
					target = flag:db_ceremony_restored
				}
			}
			AND = {
				has_trait = dragonborn
				OR = {
					has_trait = p_dv_akatosh
					has_trait = p_dv_shezarr
					has_trait = p_at_fox
					has_trait = p_at_bear
				}
				prestige_level >= max_prestige_level
			}
			has_trait_xp = {
				trait = thuum_mastery
				value >= 100
			}
			AND = {
				dynasty_prestige_level >= 5
				prestige_level >= max_prestige_level
				has_trait = legend
			}
			custom_tooltip = {
				text = db_tamriel_unifier
				has_character_flag = flag_db_tamriel_unifier
			}
			custom_tooltip = {
				text = db_ysmir_dragon_of_the_north
				has_character_flag = flag_ysmir_dragon_of_the_north
			}
			custom_tooltip = {
				text = db_crush_daedra_invasion
				has_character_flag = flag_crush_daedra_invasion
			}
			AND = {
				OR = {
					has_trait = paragon
					has_trait = savior
					AND = {
						has_trait = divine_blood
						piety_level >= very_high_piety_level
					}
					AND = {
						has_trait = consecrated_blood
						piety_level >= very_high_piety_level
					}
				}
				faith = { fervor >= 45 }
				custom_description = {
					text = db_ctrl_holy_sites
					faith = {
						any_holy_site = {
							OR = {
								county.holder = root
								county.holder.top_liege = { this = root }
							}
							count >= 3
						}
					}
				}
			}
			OR = {
				AND = {
					has_trait = education_magic_5
					has_trait = arcana_good_2
				}
				AND = {
					has_trait = arcana_good_3
					has_trait = education_magic_4
				}
			}
			custom_tooltip = {
				text = have_db_amulet
				any_character_artifact = {
					has_artifact_modifier = aok_modifier
				}
			}
			custom_tooltip = {
				text = become_conqueror_decision_war_participation
				any_memory = {
					count >= 20
					OR = {
						has_memory_type = offensive_war
						has_memory_type = defensive_war
						has_memory_type = joined_allys_war
					}
				}
			}
			calc_true_if = {
				amount >= 1
				custom_tooltip = {
					text = become_conqueror_decision_two_commander_traits
					any_character_trait = {
						count >= 2
						has_trait_category = commander
					}
				}
				martial >= 28
			}
		}
	}
	
	effect = {
		custom_tooltip = {
			text = nine_divines_decision_effect_1
		}
		trigger_event = nine_divines.0001
		hidden_effect = {
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:nine_divines_decision
			}
		}
	}
}
council_nine_decision = {
	picture = { reference = "gfx/interface/illustrations/decisions/nine_divines.dds" }
	ai_check_interval = 120
	desc = council_nine_decision_desc
	decision_group_type = major
	
	is_shown = {
		is_ai = no
		is_landed = yes
		is_independent_ruler = yes
		faith = {
			OR = { #is available to faiths that worship the Divines or are otherwise part of the Divines religious sphere
				has_doctrine = doctrine_pantheon_divines
				has_doctrine = doctrine_pantheon_nord
				has_doctrine = doctrine_pantheon_breton
				has_doctrine = doctrine_pantheon_redguard
				has_doctrine = doctrine_pantheon_nedic_aedra
				has_doctrine = special_doctrine_cyrodiilic_cult
				has_doctrine = special_doctrine_bretic_traditions
			}
		}
		faith = { has_doctrine = doctrine_sp_dv_talos }
		faith = { has_doctrine = special_doctrine_talos_cult }
		highest_held_title_tier >= tier_empire
		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:council_nine_decision
			}
		}
	}
	is_valid = {
		faith = { has_doctrine = doctrine_sp_dv_talos }
		faith = { has_doctrine = special_doctrine_talos_cult }
		NOR = {
			faith = { has_doctrine = doctrine_temporal_head}
			faith = { has_doctrine = doctrine_mystical_birthright_head}
		}
		highest_held_title_tier >= tier_empire
	}
	
	cost = {
		gold = 500
        piety = 2000
	}
	
	effect = {
		custom_tooltip = {
			text = council_of_nine_creation
		}
		trigger_event = nine_divines.0003
		hidden_effect = {
			destroy_title = title:k_council_of_the_eight
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:council_nine_decision
			}
		}
	}
}