﻿restore_dragon_fire_ceremony_decision = {
	picture = { reference = "gfx/interface/illustrations/decisions/nine_divines.dds" }
	ai_check_interval = 120
	desc = restore_dragon_fire_ceremony_decision_desc
	decision_group_type = major
	
	is_shown = {
		is_ai = no
		is_landed = yes
		is_independent_ruler = yes
		completely_controls = title:c_imperial_city
		completely_controls_region = mundus_tamriel_cyrodiil_imperial_isle
		highest_held_title_tier >= tier_empire
		NOT = {
			is_target_in_global_variable_list = {
				name = mundus_barrier_switch
				target = flag:db_ceremony_restored
			}
		}
		NOR = {
			is_target_in_global_variable_list = {
				name = mundus_barrier_switch
				target = flag:db_barrier_on
			}
			is_target_in_global_variable_list = {
				name = mundus_barrier_switch
				target = flag:db_daedra_win
			}
		}
		OR = {
			has_global_variable = db_daedra_invasion_defeated
			is_target_in_global_variable_list = {
				name = mundus_barrier_switch
				target = flag:db_current_daedra_invasion
			}
			is_target_in_global_variable_list = {
				name = mundus_barrier_switch
				target = flag:db_barrier_off
			}
		}
	}

	is_valid = {
		age >= 12
		is_independent_ruler = yes
		has_trait = dragonborn
		custom_tooltip = {
			text = have_db_amulet
			any_character_artifact = {
				has_artifact_modifier = aok_modifier
			}
		}
		custom_tooltip = {
			text = db_temple_one_active
			NOT = {
				any_realm_county = {
					any_county_province = {
						has_building_or_higher = temple_of_the_one_02
					}
				}
			}
		}
	}
	
	effect = {
		trigger_event = dragon_fire.0001
		hidden_effect = {
			add_to_global_variable_list = {
				name = mundus_barrier_switch
				target = flag:db_ceremony_restored
			}
		}
	}
}

dragon_fire_ceremony_decision = {
	picture = { reference = "gfx/interface/illustrations/decisions/nine_divines.dds" }
	ai_check_interval = 120
	cooldown = { days = 5 }
	desc = dragon_fire_ceremony_decision_desc
	decision_group_type = major
	
	is_shown = {
		is_ai = no
		is_landed = yes
		is_independent_ruler = yes
		completely_controls_region = mundus_tamriel_cyrodiil_imperial_isle
		highest_held_title_tier >= tier_empire
		NOR = {
			is_target_in_global_variable_list = {
				name = mundus_barrier_switch
				target = flag:db_barrier_on
			}
			is_target_in_global_variable_list = {
				name = mundus_barrier_switch
				target = flag:db_daedra_win
			}
		}
		is_target_in_global_variable_list = {
			name = mundus_barrier_switch
			target = flag:db_barrier_off
		}
		is_target_in_global_variable_list = {
			name = mundus_barrier_switch
			target = flag:db_ceremony_restored
		}
		NOT = {
			has_realm_law = uncrowned
		}
		OR = {
			has_realm_law = crowned_king
			has_realm_law = crowned_emperor
		}
	}

	is_valid = {
		age >= 12
		is_independent_ruler = yes
		has_trait = dragonborn
		custom_tooltip = {
			text = have_db_amulet
			any_character_artifact = {
				has_artifact_modifier = aok_modifier
			}
		}
		custom_tooltip = {
			text = db_temple_one_active
			NOT = {
				any_realm_county = {
					any_county_province = {
						has_building_or_higher = temple_of_the_one_02
					}
				}
			}
		}
	}
	
	cost = {
		gold = 100
		piety = 500
	}
	effect = {
		trigger_event = dragon_fire.0001
		hidden_effect = {
			
		}
	}
}

rebuild_temple_of_the_one_decision = {
	picture = { reference ="gfx/interface/illustrations/decisions/imperial_city.dds" }
	ai_check_interval = 120
	cooldown = { days = 5 }
	desc = dragon_fire_ceremony_decision_desc
	decision_group_type = major
	
	is_shown = {
		is_ai = no
		is_landed = yes
		is_independent_ruler = yes
		completely_controls = title:c_imperial_city
		completely_controls_region = mundus_tamriel_cyrodiil_imperial_isle
		any_realm_county = {
			any_county_province = {
				has_building_or_higher = temple_of_the_one_02
			}
		}
		NOR = {
			is_target_in_global_variable_list = {
				name = mundus_barrier_switch
				target = flag:db_daedra_win
			}
			is_target_in_global_variable_list = {
				name = mundus_barrier_switch
				target = flag:db_current_daedra_invasion
			}
		}
	}

	is_valid = {
		age >= 12
		is_independent_ruler = yes
		custom_tooltip = {
			text = db_temple_one_inactive
			any_realm_county = {
				any_county_province = {
					has_building_or_higher = temple_of_the_one_02
				}
			}
		}
	}
	
	cost = {
		gold = 1000
	}
	effect = {
		hidden_effect = {
			province:2068 = {
				remove_building = temple_of_the_one_02
				add_special_building = temple_of_the_one_01
			}
		}
	}
}