﻿
# v1.0
last_duel_decision = {
	picture = {
    	reference ="gfx/interface/illustrations/decisions/nh_decision_duel.dds"
	}

	sort_order = 1
	selection_tooltip = last_duel_decision_tooltip
	ai_check_interval = 6

	desc = {
		first_valid = {

			triggered_desc = {
				trigger = { has_trait = cancer}
				desc = last_duel_decision_desc_cancer
			}

			triggered_desc = {
				trigger = { has_trait = infirm }
				desc = last_duel_decision_desc_cancer
			}

			triggered_desc = {
				trigger = { age >= 60 }
				desc = last_duel_decision_desc_old
			}

			triggered_desc = {
				trigger = { religion = religion:germanic_religion }
				desc = last_duel_decision_desc
			}
		}
	}

	is_shown = {
		OR = {
			AND = {
				age >= 60
				religion = religion:germanic_religion
			}
			AND = {
				age >= 18
				religion = religion:germanic_religion
				has_trait = cancer
			}
			AND = {
				age >= 30
				religion = religion:germanic_religion
				has_trait = infirm
			}
		}
	}

	cooldown = { days = 300 }

	is_valid_showing_failures_only = {
		is_imprisoned = no
		is_at_war = no
		not = { exists = involved_activity }
	}

	effect = {
		trigger_event = {
			id = nh.0001
			days = {5 10}
		}
	}

	ai_potential = {
		highest_held_title_tier > tier_barony
		is_playable_character  = yes
		faith = faith:norse_pagan
	}

	ai_will_do = {
		base = 10

		modifier = {
            add = 70
            has_trait = faith_warrior
        }

		modifier = {
            add = 30
            has_trait = brave
        }

		modifier = {
            add = 15
            has_trait = zealous
        }

		modifier = {
            add = 15
            has_trait = holy_warrior
        }

		modifier = {
            add = 10
            prowess >= 25
        }

		modifier = {
            add = -100
            has_trait = craven
        }
	}
}

nh_rome_hs_decision = {
	picture = {
    	reference ="gfx/interface/illustrations/decisions/nh_decision_rome_hs.dds"
	}

	decision_group_type = nordic_honor
	desc = nh_rome_hs_decision_desc
	selection_tooltip = nh_rome_hs_decision_tooltip

	sort_order = 0

	ai_check_interval = 300

	# only shown if faith is unreformed
	is_shown = {
		is_playable_character = yes
		OR = {
			faith = faith:norse_pagan
			faith = faith:forn_sidr_pagan
			faith = faith:odinstru_pagan
		}
		NOR = {
			AND = {
				faith = faith:norse_pagan
				is_target_in_global_variable_list = {
					name = unavailable_unique_decisions
					target = flag:nh_rome_hs_norse_decision
				}
			}
			AND = {
				faith = faith:forn_sidr_pagan
				is_target_in_global_variable_list = {
					name = unavailable_unique_decisions
					target = flag:nh_rome_hs_forn_sidr_decision
				}
			}
			AND = {
				faith = faith:odinstru_pagan
				is_target_in_global_variable_list = {
					name = unavailable_unique_decisions
					target = flag:nh_rome_hs_odinstru_decision
				}
			}
		}
	}

	is_valid ={
		highest_held_title_tier >= tier_kingdom
		completely_controls = title:d_latium
		OR ={
			has_trait = zealous
			has_trait = theologian
			has_trait = holy_warrior
			piety_level >= 5
		}
	}

	is_valid_showing_failures_only = {
		is_capable_adult = yes
		is_imprisoned = no
		is_independent_ruler = yes
		is_at_war = no
		not = { exists = involved_activity }
	}

	cost = {
		gold = 1000
		prestige = 5000
		piety = 2000
	}

	effect = {
		trigger_event = {
			id = nh.1001
		}

		dynasty = {
			add_dynasty_prestige = 1000
		}

			# Guard activation with has_holy_site per standards
			if = {
				limit = { root.faith = { has_holy_site = joromaborg } }
				root.faith = { activate_holy_site = joromaborg }
			}

		#Can only happen once per faith
		if = {
			limit = { faith = faith:norse_pagan }
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:nh_rome_hs_norse_decision
			}
		}
		else_if = {
			limit = { faith = faith:forn_sidr_pagan }
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:nh_rome_hs_forn_sidr_decision
			}
		}
		else_if = {
			limit = { faith = faith:odinstru_pagan }
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:nh_rome_hs_odinstru_decision
			}
		}

	}

	ai_potential = {always = yes}

	ai_will_do = {base = 100}
}

nh_constantinople_hs_decision = {
	picture = {
    	reference ="gfx/interface/illustrations/decisions/nh_decision_constantinople_hs.dds"
	}

	decision_group_type = nordic_honor
	desc = nh_constantinople_hs_decision_desc
	selection_tooltip = nh_constantinople_hs_decision_tooltip

	sort_order = 0

	ai_check_interval = 300

	# only shown if faith is unreformed
	is_shown = {
		is_playable_character = yes
		OR = {
			faith = faith:norse_pagan
			faith = faith:heidinn_pagan
			faith = faith:odinstru_pagan
		}
		NOR = {
			AND = {
				faith = faith:norse_pagan
				is_target_in_global_variable_list = {
					name = unavailable_unique_decisions
					target = flag:nh_constantinople_hs_norse_decision
				}
			}
			AND = {
				faith = faith:heidinn_pagan
				is_target_in_global_variable_list = {
					name = unavailable_unique_decisions
					target = flag:nh_constantinople_hs_heidinn_decision
				}
			}
			AND = {
				faith = faith:odinstru_pagan
				is_target_in_global_variable_list = {
					name = unavailable_unique_decisions
					target = flag:nh_constantinople_hs_odinstru_decision
				}
			}
		}
	}

	is_valid ={
		highest_held_title_tier >= tier_kingdom
		completely_controls = title:d_thrace
		OR ={
			has_trait = zealous
			has_trait = theologian
			has_trait = holy_warrior
			piety_level >= 5
		}
	}

	is_valid_showing_failures_only = {
		is_capable_adult = yes
		is_imprisoned = no
		is_independent_ruler = yes
		is_at_war = no
		not = { exists = involved_activity }
	}

	cost = {
		gold = 1000
		prestige = 5000
		piety = 2000
	}

	effect = {
		trigger_event = {
			id = nh.1002
		}

		dynasty = {
			add_dynasty_prestige = 1000
		}

			# Guard activation with has_holy_site per standards
			if = {
				limit = { root.faith = { has_holy_site = miklagard } }
				root.faith = { activate_holy_site = miklagard }
			}

		#Can only happen once per faith
		if = {
			limit = { faith = faith:norse_pagan }
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:nh_constantinople_hs_norse_decision
			}
		}
		else_if = {
			limit = { faith = faith:heidinn_pagan }
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:nh_constantinople_hs_heidinn_decision
			}
		}
		else_if = {
			limit = { faith = faith:odinstru_pagan }
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:nh_constantinople_hs_odinstru_decision
			}
		}

	}

	ai_potential = {always = yes}

	ai_will_do = {base = 100}
}

nh_peace_christianity_decision = {
	picture = {
    	reference = "gfx/interface/illustrations/decisions/nh_peace_christianity_decision.dds"
	}
	decision_group_type = nordic_honor
	desc = nh_peace_christianity_decision_desc
	selection_tooltip = nh_peace_christianity_decision_tooltip

	sort_order = 0

	ai_check_interval = 10

	# only shown if faith is unreformed
	is_shown = {
		is_playable_character = yes
		faith = faith:natturugudtruar_pagan

		#Not repeatable.
		NOT = {
			AND = {
				faith = faith:natturugudtruar_pagan
				is_target_in_global_variable_list = {
					name = unavailable_unique_decisions
					target = flag:nh_peace_christianity_decision
				}
			}
		}
	}

	is_valid ={
		highest_held_title_tier >= tier_kingdom

		# unreformed
		faith = faith:natturugudtruar_pagan

		# strong faith
		custom_description = {
			text = "nh_peace_christianity_trigger"
			faith = { holy_sites_controlled = 3 }
		}
		piety_level >= 5


		#Must be in/adjacent to the Viking Age.
		NOT = {
			culture = { has_cultural_era_or_later = culture_era_high_medieval }
		}
	}

	is_valid_showing_failures_only = {
		is_capable_adult = yes
		is_imprisoned = no
		is_independent_ruler = yes
		is_at_war = no
		not = { exists = involved_activity }
	}

	cost = { # easy for AI
		piety = {
			value = 500
			if = {
				limit = { is_ai = no }
				add = 4500
			}
		}
		prestige = {
			value = 1000
			if = {
				limit = { is_ai = no }
				add = 4000
			}
		}
	}

	effect = {
		trigger_event = {
			id = nh.1003
		}

		dynasty = {
			add_dynasty_prestige = 1000
		}


		#Can only happen once
		add_to_global_variable_list = {
			name = unavailable_unique_decisions
			target = flag:nh_peace_christianity_decision
		}
	}

	ai_potential = {always = yes}

	ai_will_do = {base = 100}
}

nh_convert_whole_realm_to_feudalism_decision = {
	picture = {
    	reference = "gfx/interface/illustrations/decisions/nh_pagan_feudalize.dds"
	}
	decision_group_type = nordic_honor
	desc = nh_convert_whole_realm_to_feudalism_decision_desc

	ai_check_interval = 36

	is_shown = {
		AND ={
			government_has_flag = government_is_tribal
			faith = { has_doctrine_parameter = unreformed }
		}
		OR = {
			culture = { has_cultural_pillar = heritage_central_germanic }
			culture = { has_cultural_pillar = heritage_west_germanic }
			culture = { has_cultural_pillar = heritage_north_germanic }
		}
		OR = {
			is_independent_ruler = yes
			AND = {
				is_independent_ruler = no
				liege = {
					NOR = {
						government_has_flag = government_is_feudal
						government_has_flag = government_is_clan
					}
				}
			}
		}
	}

	is_valid = {
		has_realm_law = tribal_authority_3
		custom_description = {
			text = nh_faith_is_unreformed
			subject = root
			faith = { has_doctrine_parameter = unreformed }
		}
		prestige_level >= 5
		capital_province.county = {
			development_level >= nh_convert_to_feudalism_development_requirement
		}

		custom_description = { #You need to have 85% of all (non-regional/unique) tribal innovations!
			text = nh_has_all_tribal_innovation
			subject = root.culture
			culture = {
				calc_true_if = {
					amount >= 12
					has_innovation = innovation_motte
					has_innovation = innovation_catapult
					has_innovation = innovation_barracks
					has_innovation = innovation_mustering_grounds
					has_innovation = innovation_bannus
					has_innovation = innovation_quilted_armor
					has_innovation = innovation_gavelkind
					has_innovation = innovation_crop_rotation
					has_innovation = innovation_city_planning
					has_innovation = innovation_casus_belli
					has_innovation = innovation_plenary_assemblies
					has_innovation = innovation_ledger
					has_innovation = innovation_development_01
					has_innovation = innovation_currency_01
				}
			}
		}
	}

	is_valid_showing_failures_only = {
		is_capable_adult = yes
		is_imprisoned = no
		is_at_war = no
		not = { exists = involved_activity }
	}

	cost = {
		prestige = {
			value = 1000
			if = {
				limit = { is_ai = no }
				add = 7000
			}
		}
	}

	effect = {
		trigger_event = major_decisions.0001
		save_scope_as = actor
		convert_whole_realm_to_feudalism_effect = yes
		hidden_effect = {
			every_vassal = {
				trigger_event = {
					id = major_decisions.0002
					days = 3
				}
			}
		}
	}

	ai_potential = {
		NOT = { has_title = title:e_mongol_empire } #Stop the Mongols from slowing their conquest.
	}

	ai_will_do = {
		base = 100
	}
}

nh_convert_to_christianity_iceland_decision = {
	picture = {
    	reference ="gfx/interface/illustrations/decisions/decision_personal_religious.dds"
	}

	decision_group_type = nordic_honor
	desc = nh_convert_to_christianity_iceland_decision_desc
	selection_tooltip = nh_convert_to_christianity_iceland_decision_tooltip
	ai_goal = yes

	ai_check_interval = 3


	is_shown = {
		is_lowborn = no
		OR = {
     		faith = faith:ginnregla_pagan
     		faith = faith:norse_pagan
		}

		OR = {
			this = character:168609
			this = character:180257
		}
		OR = {
			exists = character:168609
			exists = character:180257
		}

		#Not repeatable.
		NOR = {
			AND = {
				this = character:168609
				is_target_in_global_variable_list = {
					name = unavailable_unique_decisions
					target = flag:nh_convert_to_christianity_iceland_fletnefir_decision
				}
			}
			AND = {
				this = character:180257
				is_target_in_global_variable_list = {
					name = unavailable_unique_decisions
					target = flag:nh_convert_to_christianity_iceland_svarson_decision
				}
			}
		}
	}

	is_valid = {
		# has_realm_law = tribal_authority_2
		custom_description = {
			text = nh_faith_is_unreformed
			subject = root
			faith = { has_doctrine_parameter = unreformed }
		}
	}

	is_valid_showing_failures_only = {
		is_capable_adult = yes
		is_imprisoned = no
		is_at_war = no
		not = { exists = involved_activity }
		OR = {
			this = character:168609
			this = character:180257
		}
	}

	cost = {
		piety = {
			value = 0
			if = {
				limit = { is_ai = no }
				add = 500
			}
		}
	}

	effect = {
		trigger_event = nh.1004
		save_scope_as = actor

		dynasty = {
			add_dynasty_prestige = 250
		}

		if = {
			limit = { this = character:168609 }
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:nh_convert_to_christianity_iceland_fletnefir_decision
			}
		}
		else_if = {
			limit = { this = character:180257 }
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:nh_convert_to_christianity_iceland_svarson_decision
			}
		}
	}

	ai_potential = { always = yes }

	ai_will_do = {
		base = 100
	}
}

nh_form_old_saxia_kingdom_decision = {
	picture = {
    	reference ="gfx/interface/illustrations/decisions/nh_form_old_saxia_kingdom_decision.dds"
	}
	decision_group_type = nordic_honor
	desc = nh_form_old_saxia_kingdom_decision_desc
	selection_tooltip = nh_form_old_saxia_kingdom_decision_tooltip
	ai_check_interval = 36

	is_shown = {
		is_playable_character = yes
		NOT = { exists = title:k_old_saxia.holder }
		NOT = {  #Can only do it once.
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_formed_old_saxia_kingdom
			}
		}
		OR = {
			culture = { has_cultural_pillar = heritage_central_germanic }
			culture = { has_cultural_pillar = heritage_west_germanic }
			culture = { has_cultural_pillar = heritage_north_germanic }
		}
		highest_held_title_tier <= tier_duchy
		#Must hold land within the relevant areas directly.
		any_held_title = {
			tier = tier_county
			title_province = { geographical_region = custom_old_saxia }
		}
	}

	is_valid = {
		#Must be suitably prestigious.
		prestige_level >= high_prestige_level
		#Must control saxia
		completely_controls_region = custom_old_saxia
		#Must be done within/near Viking age
		NOT = {
			culture = { has_cultural_era_or_later = culture_era_high_medieval }
		}
		NOT = { dynasty = dynasty:25061 }
	}

	is_valid_showing_failures_only = {
		is_capable_adult = yes
		is_imprisoned = no
		is_at_war = no
		not = { exists = involved_activity }
		#Must not be of the Karling dynasty
		custom_description = {
			text = "nh_form_old_saxia_dynasty_trigger"
			NOT = { dynasty = dynasty:25061 }
		}
	}

	cost = {	#cheap for AI
		piety = {
			value = 500
			if = {
				limit = { is_ai = no }
				add = 1500
			}
		}
		prestige = {
			value = 1000
			if = {
				limit = { is_ai = no }
				add = 4000
			}
		}
	}

	effect = {
		show_as_tooltip = {
			form_nh_old_saxony_scripted_effect = yes
		}

		dynasty = {
			add_dynasty_prestige = 1000
		}

		trigger_event = {
			id = nh.1005
		}
		hidden_effect = {
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_formed_old_saxia_kingdom
			}
			set_global_variable = {
				name = flag_formed_old_saxia_kingdom
				value = root
			}
		}
	}

	ai_potential = {
		prestige_level >= high_prestige_level
	}

	ai_will_do = {
		base = 0

		modifier = {
			add = 20
			capital_county.title_province = { geographical_region = custom_old_saxia }
		}
		modifier = {
				add = -40
				has_trait = chaste
			}
		modifier = {
				add = -40
				has_trait = compassionate
			}
		modifier = {
				add = -40
				has_trait = forgiving
			}
		modifier = {
				add = 60
				has_trait = brave
				capital_county.title_province = { geographical_region = custom_old_saxia }
			}
		modifier = {
				add = 60
				has_trait = vengeful
				capital_county.title_province = { geographical_region = custom_old_saxia }
			}
		modifier = {
				add = 60
				has_trait = wrathful
				capital_county.title_province = { geographical_region = custom_old_saxia }
			}
	}
}

# v1.1
nh_rollos_adventure_decision = {
	picture = {
    	reference ="gfx/interface/illustrations/decisions/nh_rollos_adventure_decision.dds"
	}

	decision_group_type = nordic_honor
	desc = nh_rollos_adventure_decision_desc
	selection_tooltip = nh_rollos_adventure_decision_tooltip
	ai_goal = yes

	ai_check_interval = 6


	is_shown = {
		is_lowborn = no
		religion = religion:germanic_religion

		exists = character:242
		this = character:242

		#Not repeatable.
		NOT = {
			AND = {
				this = character:242
				is_target_in_global_variable_list = {
					name = unavailable_unique_decisions
					target = flag:nh_rollos_adventure_decision
				}
			}
		}
	}

	is_valid = {
		custom_description = {
			text = nh_faith_is_unreformed
			subject = root
			faith = { has_doctrine_parameter = unreformed }
		}
	}

	is_valid_showing_failures_only = {
		is_capable_adult = yes
		is_imprisoned = no
		is_at_war = no
		not = { exists = involved_activity }
		this = character:242
	}

	cost = { # only players pay a cost
		gold = {
			value = 0
			if = {
				limit = { is_ai = no }
				add = 500
			}
		}
		prestige = {
			value = 0
			if = {
				limit = { is_ai = no }
				add = 2000
			}
		}
	}

	effect = {
		trigger_event = nh.1011
		save_scope_as = actor

		if = {
			limit = { this = character:242 }
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:nh_rollos_adventure_decision
			}
		}
	}

	ai_potential = { prestige_level >= 2 }

	ai_will_do = {
		base = 100
	}
}

nh_gotland_policy_decision = {
	picture = {
    	reference ="gfx/interface/illustrations/decisions/nh_gotland_policy_decision.dds"
	}

	sort_order = 2
	selection_tooltip = nh_gotland_policy_decision_tooltip
	desc = nh_gotland_policy_decision_desc
	ai_check_interval = 12

	cooldown = { years = 10 }

	is_shown = {
		religion = religion:germanic_religion
		has_title = title:c_gutland
		OR = {
			culture = { has_cultural_pillar = heritage_north_germanic }
			culture = { has_cultural_pillar = heritage_central_germanic }
		}

	}

	is_valid = {
		custom_description = {
			text = nh_faith_is_unreformed
			subject = root
			faith = { has_doctrine_parameter = unreformed }
		}
		has_title = title:d_gotland
		custom_description = {
			text = nh_within_viking_age
			subject = root
			NOT = {culture = { has_cultural_era_or_later = culture_era_high_medieval }}
		}
	}

	is_valid_showing_failures_only = {
		is_capable_adult = yes
		is_imprisoned = no
		is_at_war = no
		not = { exists = involved_activity }
	}

	cost = {	#cheap for AI
		prestige = {
			value = 200
			if = {
				limit = { is_ai = no }
				add = 1800
			}
		}
	}

	effect = {
		trigger_event = nh.1013
		save_scope_as = actor
	}

	ai_potential = { always = yes }

	ai_will_do = {
		base = 100
	}
}

nh_iceland_first_great_ting = {
	picture = {
    	reference ="gfx/interface/illustrations/decisions/nh_iceland_great_ting.dds"
	}

	decision_group_type = nordic_honor
	desc = nh_iceland_first_great_ting_desc
	selection_tooltip = nh_iceland_first_great_ting_tooltip
	ai_goal = yes

	ai_check_interval = 36

	is_shown = {
		is_lowborn = no
		faith = faith:ginnregla_pagan
		any_held_title = {
			tier = tier_county
			title_province = { geographical_region = custom_iceland}
		}

		#Not repeatable.
		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:nh_iceland_first_great_ting
			}
		}
	}

	is_valid = {
		# unreformed
		custom_description = {
			text = nh_faith_is_unreformed
			subject = root
			faith = { has_doctrine_parameter = unreformed }
		}

		# hold relevant titles
		has_title = title:d_iceland
		highest_held_title_tier <= tier_duchy
		# completely_controls_region = custom_iceland
		OR = {
			AND = {
				is_ai = yes
				any_held_title = {
					tier = tier_county
					title_province = { geographical_region = custom_iceland}
				}
			}
			AND = {
				is_ai = no
				any_held_title = {
					tier = tier_county
					title_province = { geographical_region = custom_ai_iceland}
				}
			}
		}

		#Must be done within/near Viking age
		NOT = {
			culture = { has_cultural_era_or_later = culture_era_high_medieval }
		}
	}

	is_valid_showing_failures_only = {
		is_capable_adult = yes
		is_imprisoned = no
		is_at_war = no
		not = { exists = involved_activity }
	}

	cost = { # easy for AI
		gold = {
			value = 5
			if = {
				limit = { is_ai = no }
				add = 495
			}
		}
		prestige = {
			value = 2000
			if = {
				limit = { is_ai = no }
				add = 2000
			}
		}
	}

	effect = {
		save_scope_as = actor

		show_as_tooltip = {
			form_nh_iceland_scripted_effect = yes
		}

		dynasty = {
			add_dynasty_prestige = 750
		}

		trigger_event = nh.1014

		hidden_effect = {
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:nh_iceland_first_great_ting
			}
			set_global_variable = {
				name = nh_iceland_first_great_ting
				value = root
			}
		}
	}

	ai_potential = { always = yes }

	ai_will_do = {
		base = 100
	}
}

nh_iceland_yearly_ting = {
	picture = {
    	reference ="gfx/interface/illustrations/decisions/nh_iceland_great_ting.dds"
	}

	desc = nh_iceland_yearly_ting_desc
	selection_tooltip = nh_iceland_yearly_ting_tooltip

	ai_check_interval = 36
	cooldown = { years = 3 }

	is_shown = {
		is_lowborn = no
		any_held_title = {
			tier = tier_county
			title_province = { geographical_region = custom_iceland}
		}
	}

	is_valid = {
		#restricted to norse icelandic folk
		faith = faith:ginnregla_pagan
		culture = { has_cultural_pillar = heritage_north_germanic }

		# unreformed
		custom_description = {
			text = nh_faith_is_unreformed
			subject = root
			faith = { has_doctrine_parameter = unreformed }
		}
		# Thingvellirhold relevant Titles
		has_title = title:c_sudurland
		has_title = title:d_iceland
	}

	is_valid_showing_failures_only = {
		is_capable_adult = yes
		is_imprisoned = no
		is_at_war = no
		not = { exists = involved_activity }
	}

	cost = { # easy for AI
		piety = {
			value = 500
			if = {
				limit = { is_ai = no }
				add = 500
			}
		}
		prestige = {
			value = 1000
			if = {
				limit = { is_ai = no }
				add = 1000
			}
		}
	}

	effect = {
		save_scope_as = actor
		trigger_event = nh.1015
		dynasty = {
			add_dynasty_prestige = 50
		}
	}

	ai_potential = { always = yes }

	ai_will_do = {
		base = 100
	}
}
