﻿namespace = DE_decision_event


DE_decision_event.0001 = { #Found the Kingdom of Oman
	title = DE_decision_event.0001.t
	desc = DE_decision_event.0001.desc
	theme = new_royal_court
	left_portrait = {
		character = this
	}

	option = { 
		name = DE_decision_event.0001.a
		
		ai_chance = {
			base = 100
		}
	}
}

DE_decision_event.0002 = { # Restore the Kingdom of Old Saxony
	title = DE_decision_event.0002.t
	desc = DE_decision_event.0002.desc
	theme = new_royal_court
	left_portrait = {
		character = this
	}

	option = { 
		name = DE_decision_event.0002.a
		
		ai_chance = {
			base = 100
		}
	}
}

DE_decision_event.0003 = { # Form the Grand Duchy of Saxony
	title = DE_decision_event.0003.t
	desc = DE_decision_event.0003.desc
	theme = new_royal_court
	left_portrait = {
		character = this
	}

	option = { 
		name = DE_decision_event.0003.a
		
		ai_chance = {
			base = 100
		}
	}
}

DE_decision_event.0004 = { # Form the Grand Duchy of Franconia
	title = DE_decision_event.0004.t
	desc = DE_decision_event.0004.desc
	theme = new_royal_court
	left_portrait = {
		character = this
	}

	option = { 
		name = DE_decision_event.0004.a
		
		ai_chance = {
			base = 100
		}
	}
}

DE_decision_event.0005 = { # Form the Grand Duchy of Swabia
	title = DE_decision_event.0005.t
	desc = DE_decision_event.0005.desc
	theme = new_royal_court
	left_portrait = {
		character = this
	}

	option = { 
		name = DE_decision_event.0005.a
		
		ai_chance = {
			base = 100
		}
	}
}

DE_decision_event.0006 = { # Form the Bulgarian Empire	 
	type = character_event
	title = DE_decision_event.0006.t
	desc = DE_decision_event.0006.desc
	theme = new_royal_court
	left_portrait = {
		character = root
		animation = personality_zealous
	}

	option = { 
		name = DE_decision_event.0006.a
		
		ai_chance = {
			base = 100
		}
	}
}

DE_decision_event.0007 = { # Reform the Avar Khaganate 	        
	title = DE_decision_event.0007.t
	desc = DE_decision_event.0007.desc
	theme = war
	override_background = {
		reference = wilderness_steppe
	}
	left_portrait = {
		character = this
		animation = celebrate_sword
	}

	option = { 
		name = DE_decision_event.0007.a
		
		ai_chance = {
			base = 100
		}
	}
}

# DE_decision_event.0008 = { # Integrate the Kingdom of Aquitaine      
# 	title = DE_decision_event.0008.t
# 	desc = DE_decision_event.0008.desc
# 	theme = new_royal_court
# 	left_portrait = {
# 		character = this
# 	}

# 	option = { 
# 		name = DE_decision_event.0008.a
		
# 		ai_chance = {
# 			base = 100
# 		}
# 	}
# }

DE_decision_event.0009 = { # Restore the Kingdom of Aquitaine
	title = DE_decision_event.0009.t
	desc = DE_decision_event.0009.desc
	theme = new_royal_court
	left_portrait = {
		character = this
	}

	option = { 
		name = DE_decision_event.0009.a
		
		ai_chance = {
			base = 100
		}
	}
}

DE_decision_event.0010 = { # Reform Samo's Empire     
	title = DE_decision_event.0010.t
	desc = DE_decision_event.0010.desc
	theme = new_royal_court
	left_portrait = {
		character = this
	}

	option = { 
		name = DE_decision_event.0010.a
		
		ai_chance = {
			base = 100
		}
	}
}

DE_decision_event.0011 = { # Restore the Frisian Kingdom 
	title = DE_decision_event.0011.t
	desc = DE_decision_event.0011.desc
	theme = new_royal_court
	left_portrait = {
		character = this
	}

	option = { 
		name = DE_decision_event.0011.a
		
		ai_chance = {
			base = 100
		}
	}
}

scripted_effect add_innovation_if_missing_effect = {	
	if = {
		limit = {
			NOT = {
				has_innovation = $INNOVATION$
			}
		}
		add_innovation = $INNOVATION$
	}
}

DE_decision_event.0012 = { # Modified Unify Italy
	type = character_event
	title = DE_decision_event.0012.t
	desc = DE_decision_event.0012.desc
	theme = realm
	left_portrait = {
		character = root
		animation = personality_greedy
	}

	option = {
		name = DE_decision_event.0012.a

		every_culture_global = {
			limit = { has_cultural_pillar = heritage_latin }

			add_innovation_if_missing_effect = { INNOVATION = innovation_men_at_arms }
			add_innovation_if_missing_effect = { INNOVATION = innovation_pike_columns }
			add_innovation_if_missing_effect = { INNOVATION = innovation_guilds }
		}

		# Send narrative fluff to other players (if any).
		every_player = {
			limit = {
				NOT = { this = root }
				capital_province = { geographical_region = world_europe_west }
			}
			trigger_event = roman_restoration.0141
		}
		hidden_effect = { # Latins chance to convert to French.
			every_vassal = {
				limit = {
					capital_province = {
						geographical_region = world_europe_south_italy
					}
					is_ai = yes
				}
				random = {
					chance = 50
					set_culture_same_as = root
					capital_county = {
						set_county_culture = root.culture
					}
				}
			}
		}
	}
}

# A disillusioned ruler seeks out and sponsors the restoration of the Zoroastrian Faith.
DE_decision_event.0017 = {
	type = character_event
	title = DE_decision_event.0017.t
	
	desc = {
		desc = DE_decision_event.0017.desc.intro
		# Nab the rationalisation.
		desc = {
			# We order these according to approximate rarity level/importance.
			## They're kept isolated in a scripted trigger file so that we can maintain easy parity between the decision rationales & the event desc rationales.
			first_valid = {
				# Excommunicated
				triggered_desc = {
					trigger = { favour_the_countryside_basques_rationale_excommunicated_trigger = yes }
					desc = DE_decision_event.0017.desc.excommunicated
				}
				# Rivalry with HoF
				triggered_desc = {
					trigger = { favour_the_countryside_basques_rationale_hof_rivalry_trigger = yes }
					desc = DE_decision_event.0017.desc.rivalry_with_hof
				}
				# Negative Piety Level
				triggered_desc = {
					trigger = { favour_the_countryside_basques_rationale_negative_piety_level_trigger = yes }
					desc = DE_decision_event.0017.desc.negative_piety_level
				}
				# Easter egg: the Lorgar special
				triggered_desc = {
					trigger = { has_trait = zealous }
					desc = DE_decision_event.0017.desc.lorgar
				}
				# Sinful Traits
				triggered_desc = {
					trigger = { favour_the_countryside_basques_rationale_sinful_traits_trigger = yes }
					desc = DE_decision_event.0017.desc.sinful_traits
				}
				# Virtuous Basque pagan traits
				triggered_desc = {
					trigger = { favour_the_countryside_basques_rationale_virtuous_basque_pagan_traits_trigger = yes }
					desc = DE_decision_event.0017.desc.virtuous_basque_pagan_traits
				}
				# Naked cynicism; we use this as the fallback.
				desc = DE_decision_event.0017.desc.naked_cynicism
			}
		}
		desc = DE_decision_event.0017.desc.outro
	}
	
	theme = faith
	
	left_portrait = {
		character = scope:religious_leader
		animation = scheme
	}
	
	right_portrait = {
		character = scope:scandalised_cleric
		animation = stress
	}
	
	override_background = { reference = wilderness_desert }

	immediate = { play_music_cue = "mx_cue_faith_conversion" }

	option = { 
		name = DE_decision_event.0017.a
		
		ai_chance = {
			base = 100
		}
	}

	after = {
		# And finally, actually apply the effects.
		## Our default stuff.
		restore_the_faith_of_zoroaster_decision_generic_effects_scripted_effect = yes
	}
}

DE_decision_event.0018 = { # Fulfill the Hadith of Conquest
	title = DE_decision_event.0018.t
	desc = DE_decision_event.0018.desc
	theme = new_royal_court
	left_portrait = {
		character = root
		animation = personality_honorable
	}

	option = { 
		name = DE_decision_event.0018.a
		
		ai_chance = {
			base = 100
		}
	}
	
	after = {
		# And finally, actually apply the effects.
		## Our default stuff.
		fulfill_the_conquest_hadith_scripted_effect = yes
	}
}

DE_decision_event.0019 = { # Enact the Komenian Reforms
	scope = none
	hidden = yes

	immediate = {
		reform_byz_military_decision_scripted_effect = yes
	}
}

DE_decision_event.0020 = { # Found the City of Cairo
	title = DE_decision_event.0020.t
	desc = DE_decision_event.0020.desc
	theme = new_royal_court
	left_portrait = {
		character = root
		animation = personality_bold
	}

	immediate = {
		establish_cairo_scripted_effect = yes
	}

	option = { 
		name = DE_decision_event.0020.a
	}

	option = {
		name = DE_decision_event.0020.b

		give_nickname = nick_the_architect
	}
}

DE_decision_event.0021 = { # Promulgate the Assizes of Ariano
	scope = none
	hidden = yes

	immediate = {
		promulgate_the_assizes_of_ariano_scripted_effect = yes
	}
}

DE_decision_event.0022 = { # Establish a new Currency System (Ducat)
	scope = none
	hidden = yes

	immediate = {
		establish_the_ducat_coin_decision_scripted_effect = yes
	}
}

DE_decision_event.0023 = { # Italian Rulers have an opportunity to embrace the Ducat
	title = DE_decision_event.0023.t
	desc = DE_decision_event.0023.desc
	theme = new_royal_court
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:king_of_sicily
		animation = personality_greedy
	}

	immediate = {
		if ={
			limit = {
				exists = title:k_sicily
			}
			title:k_sicily.holder = {
				save_scope_as = king_of_sicily
			}
		}
	}

	option = { 
		name = DE_decision_event.0023.a

		add_opinion = {
			target = scope:king_of_sicily
			modifier = pleased_opinion
			opinion = 25
		}
		
		if = {
			limit = { has_title = title:k_italy }
			title:k_italy = {
				every_in_de_jure_hierarchy = {
					custom = every_controlled_province_in_the_mediterranean_region
					limit = {
						tier = tier_county
						title_province = { geographical_region = world_europe_south_italy }
						 holder = {
							OR = {
								this = root
								target_is_liege_or_above = root
							}
						}
					}
					add_county_modifier = {
						modifier = ce_benefits_of_the_ducat_system_modifier
						years = 25
					}
				}
			}
		}
		if = {
			limit = { has_title = title:k_romagna }
			title:k_romagna = {
				every_in_de_jure_hierarchy = {
					custom = every_controlled_province_in_the_mediterranean_region
					limit = {
						tier = tier_county
						title_province = { geographical_region = world_europe_south_italy }
						 holder = {
							OR = {
								this = root
								target_is_liege_or_above = root
							}
						}
					}
					add_county_modifier = {
						modifier = ce_benefits_of_the_ducat_system_modifier
						years = 25
					}
				}
			}
		}
		if = {
			limit = { has_title = title:k_sardinia }
			title:k_sardinia = {
				every_in_de_jure_hierarchy = {
					custom = every_controlled_province_in_the_mediterranean_region
					limit = {
						tier = tier_county
						title_province = { geographical_region = world_europe_south_italy }
						 holder = {
							OR = {
								this = root
								target_is_liege_or_above = root
							}
						}
					}
					add_county_modifier = {
						modifier = ce_benefits_of_the_ducat_system_modifier
						years = 25
					}
				}
			}
		}
		if = {
			limit = { has_title = title:k_venice }
			title:k_venice = {
				every_in_de_jure_hierarchy = {
					custom = every_controlled_province_in_the_mediterranean_region
					limit = {
						tier = tier_county
						title_province = { geographical_region = world_europe_south_italy }
						 holder = {
							OR = {
								this = root
								target_is_liege_or_above = root
							}
						}
					}
					add_county_modifier = {
						modifier = ce_benefits_of_the_ducat_system_modifier
						years = 25
					}
				}
			}
		}
		if = {
			limit = { has_title = title:k_genoa }
			title:k_genoa = {
				every_in_de_jure_hierarchy = {
					custom = every_controlled_province_in_the_mediterranean_region
					limit = {
						tier = tier_county
						title_province = { geographical_region = world_europe_south_italy }
						 holder = {
							OR = {
								this = root
								target_is_liege_or_above = root
							}
						}
					}
					add_county_modifier = {
						modifier = ce_benefits_of_the_ducat_system_modifier
						years = 25
					}
				}
			}
		}
		if = {
			limit = { has_title = title:k_pisa }
			title:k_pisa = {
				every_in_de_jure_hierarchy = {
					custom = every_controlled_province_in_the_mediterranean_region
					limit = {
						tier = tier_county
						title_province = { geographical_region = world_europe_south_italy }
						 holder = {
							OR = {
								this = root
								target_is_liege_or_above = root
							}
						}
					}
					add_county_modifier = {
						modifier = ce_benefits_of_the_ducat_system_modifier
						years = 25
					}
				}
			}
		}
		
		ai_chance = {
			base = 1000
		}
	}
	
	option = { 
		name = DE_decision_event.0023.b
		
		ai_chance = {
			base = 0
		}
	}
}

DE_decision_event.0024 = { # Muslims in Sicily Question
	title = DE_decision_event.0024.t
	desc = DE_decision_event.0024.desc
	theme = new_royal_court
	left_portrait = {
		character = root
		animation = personality_rational
	}

	immediate = {

	}

	option = { 
		name = DE_decision_event.0024.a
		
		custom_tooltip = relocate_sicilian_muslims_decision_tooltip

		hidden_effect = {
			resettle_sicilian_muslims_decision_scripted_effect = yes
		}
		
		ai_chance = {
			base = 0
		}
	}

	option = { 
		name = DE_decision_event.0024.b

		custom_tooltip = protect_sicilian_muslims_decision_tooltip

		hidden_effect = {
			protect_sicilian_muslims_decision_scripted_effect = yes
		}
		
		ai_chance = {
			base = 0
		}
	}

	option = { 
		name = DE_decision_event.0024.c

		custom_tooltip = exile_sicilian_muslims_decision_tooltip

		hidden_effect = {
			exile_sicilian_muslims_decision_scripted_effect = yes
		}
		
		ai_chance = {
			base = 0
		}
	}

	option = {
		name = DE_decision_event.0024.d

		trigger = {
			OR = {
				has_trait = zealous
				has_trait = callous
				has_trait = sadistic
			}
		}

		custom_tooltip = massacre_sicilian_muslims_decision_tooltip

		hidden_effect = {
			massacre_sicilian_muslims_decision_scripted_effect = yes
		}
		
		ai_chance = {
			base = 0
		}
	}
}

DE_decision_event.0025 = { #Establish Transcaucasia
	title = DE_decision_event.0025.t
	desc = DE_decision_event.0025.desc
	theme = new_royal_court
	left_portrait = {
		character = this
	}

	option = { 
		name = DE_decision_event.0025.a
		
		ai_chance = {
			base = 100
		}
	}
}