########################################
# Made by Parmelion
########################################

namespace = flavor_geo

# A Troubled Realm
country_event = {
	id = flavor_geo.1
	title = flavor_geo.1.t
	desc = flavor_geo.1.d
	picture = PANIC_eventPicture
	trigger = {
		tag = GEO
		not = { has_country_modifier = geo_powerful_nobles }
		has_dlc = "King of Kings"
		NOT = { has_country_flag = geo_received_starting_event } 
	}	
	fire_only_once = yes
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			add_legitimacy = -20
			add_country_modifier = {
				name = "geo_powerful_nobles"
				duration = -1
				desc = geo_modifier_nobles_disaster
			}
			set_country_flag = geo_received_starting_event
		}
	}

	option = {
		name = flavor_geo.1.a
		tooltip = {
			add_legitimacy = -20
			add_country_modifier = {
				name = "geo_powerful_nobles"
				duration = -1
				desc = geo_modifier_nobles_disaster
			}
		}
		custom_tooltip = georgia_starting_event_tt
	}
}

# Throne of the Romans
country_event = {
	id = flavor_geo.2
	title = flavor_geo.2.t
	desc = flavor_geo.2.d
	picture = BYZ_BYZANTINE_EAGLE_eventPicture
	
	is_triggered_only = yes
	
	fire_only_once = yes
	
	major = yes

	option = {
		name = flavor_geo.2.a
		if = {
			limit = { 151 = { NOT = { religion = ROOT } } }
			151 = { change_religion = ROOT }
		}
		if = {
			limit = { NOT = { government_rank = 3 } }
			set_government_rank = 3
		}
		custom_tooltip = geo_move_culture_tt
		custom_tooltip = reestablishing_themes_names_tooltip
		add_country_modifier = {
			name = "geo_heirs_of_romans"
			duration = -1
		}
		custom_tooltip = geo_constantinople_decision_tt
		set_country_flag = geo_move_capital_flag
		hidden_effect = {
			if = {
				limit = { accepted_culture = armenian }
				set_country_flag = accepted_armenian
			}
			update_entire_culture = {
				culture = georgian
			}
			restore_greek_names = yes
			if = {
				limit = { has_country_flag = accepted_armenian }
				clr_country_flag = accepted_armenian
				add_accepted_culture = armenian
			}
		}
	}
}

# Sack of Sarai
country_event = {
	id = flavor_geo.3
	title = flavor_geo.3.t
	desc = flavor_geo.3.d
	picture = AB_BATTLE_eventPicture
	
	is_triggered_only = yes
	
	fire_only_once = yes
	
	option = {
		name = flavor_geo.3.a
		466 = {
			add_devastation = 100
		}
		if = {
			limit = {
				has_dlc = "Cradle of Civilization"
			}
			PA_random_army_exp_between_5_and_10_effect = yes    #PA: replaced flat gain with random dynamic gain. -- 200e200w
		}
		else = {
			add_army_tradition = 20
		}
		add_country_modifier = {
			name = geo_broke_tatar_yoke
			duration = 5475
		}
	}
	
	option = {
		name = flavor_geo.3.b
		466 = {
			add_devastation = 50
		}
		add_treasury = 250
		capital_scope = {
			add_base_tax = 2
			add_base_production = 2
			add_base_manpower = 1
		}
	}
	
	option = {
		name = flavor_geo.3.c
		add_dip_power = 100
		add_country_modifier = {
			name = geo_righteous_conquest
			duration = 5475
		}
	}
	
}

# Giorgi Saakadze
country_event = {
	id = flavor_geo.4
	title = flavor_geo.4.t
	desc = flavor_geo.4.d
	picture = ADVISOR_eventPicture
	
	mean_time_to_happen = {
		months = 40
	}
	
	fire_only_once = yes
	
	trigger = {
		OR = {
			tag = GEO
			was_tag = GEO
		}
		is_year = 1610
	}
	
	option = {
		name = flavor_geo.4.a
		define_general = {
			shock = 5
			fire = 5
			manuever = 4
			siege = 3
			name = "Giorgi Saakadze"
		}
	}
	
	option = {
		name = flavor_geo.4.b
		define_advisor = {
			type = commandant
			name = "Giorgi Saakadze"
			skill = 3
			culture = ROOT
			religion = ROOT
			cost_multiplier = 0.25
		}
	}
}

# Sulkhan-Saba Orbeliani
country_event = {
	id = flavor_geo.5
	title = flavor_geo.5.t
	desc = flavor_geo.5.d
	picture = ADVISOR_eventPicture
	
	mean_time_to_happen = {
		months = 40
	}
	
	fire_only_once = yes
	
	trigger = {
		OR = {
			tag = GEO
			was_tag = GEO
		}
		is_year = 1680
	}
	
	option = {
		name = flavor_geo.5.a
		define_advisor = {
			type = statesman
			name = "Sulkhan-Saba Orbeliani"
			skill = 3
			culture = ROOT
			religion = ROOT
			cost_multiplier = 0.33
		}
	}
	
	option = {
		name = flavor_geo.5.b
		add_dip_power = 50
	}
}

# Samtskhe Liberty Desire
country_event = {
	id = flavor_geo.6
	title = flavor_geo.6.t
	desc = flavor_geo.6.d
	picture = ACCUSATION_eventPicture
	
	mean_time_to_happen = {
		months = 40
	}
	
	fire_only_once = yes
	
	trigger = {
		OR = {
			tag = GEO
			was_tag = GEO
		}
		exists = SME
		SME = {
			is_subject_of = GEO
		}
	}
	
	option = {
		name = flavor_geo.6.a
		add_dip_power = -50
	}
	
	option = {
		name = flavor_geo.6.b
		SME = {
			add_liberty_desire = 50
		}
	}
}

# Demetrius' Ambition
country_event = {
	id = flavor_geo.7
	title = flavor_geo.7.t
	desc = flavor_geo.7.d
	picture = NOBLE_ESTATE_DEMANDS_eventPicture
	
	mean_time_to_happen = {
		months = 40
	}
	
	fire_only_once = yes
	
	trigger = {
		is_or_was_tag = { tag = GEO }
		imereti_area = {
			type = all
			country_or_non_sovereign_subject_holds = ROOT
		}
		OR = {
			has_heir = no 
			NOT = { heir_claim = 50 }
		}
		has_ruler = "Vakhtang"
	}
	
	option = {
		name = flavor_geo.7.a
		imereti_area = {
			add_local_autonomy = 50
		}
		add_country_modifier = {
			name = "geo_conceded_demands"
			duration = 3650
		}
	}
	
	option = {
		name = flavor_geo.7.b
		random_owned_province = {
			limit = {
				area = imereti_area
			}
			spawn_rebels = {
				type = nationalist_rebels
				size = 3
				leader = "Demetre Bagrationi"
				friend = IME
			}
		}
	}
}