namespace = FEE_Child_of_Destiny_Events

# Child of Destiny
country_event = {
	id = FEE_Child_of_Destiny_Events.1
	title = FEE_Child_of_Destiny_Events.1.T
	desc = FEE_Child_of_Destiny_Events.1.D
	picture = NEW_HEIR_eventPicture

	trigger = {
		has_heir_flag = fee_child_of_destiny
		NOT = { has_country_flag = fee_child_of_destiny_event_1 }
	}

	immediate = {
		hidden_effect = {
			set_country_flag = fee_child_of_destiny_event_1
			country_event = {
				id = FEE_Child_of_Destiny_Events.2
				days = 730
			}
		}
	}

	option = {
		name = FEE_Child_of_Destiny_Events.1.OPT1

		ai_chance = { factor = 100 }
	}
}

# [Root.Heir.GetName] Attacked!
country_event = {
	id = FEE_Child_of_Destiny_Events.2
	title = FEE_Child_of_Destiny_Events.2.T
	desc = FEE_Child_of_Destiny_Events.2.D
	picture = ASSASSINATION_eventPicture

	is_triggered_only = yes

	trigger = {
		has_heir_flag = fee_child_of_destiny
	}

	immediate = {
		hidden_effect = {
			country_event = {
				id = FEE_Child_of_Destiny_Events.3
				days = 730
			}
		}
	}

	option = {
		name = FEE_Child_of_Destiny_Events.2.OPT1

		ai_chance = { factor = 100 }

		custom_tooltip = cod_your_heirs_abilities_keep_growing
	}
}

# Our Heir Poisoned!
country_event = {
	id = FEE_Child_of_Destiny_Events.3
	title = FEE_Child_of_Destiny_Events.3.T
	desc = FEE_Child_of_Destiny_Events.3.D
	picture = COURT_eventPicture

	is_triggered_only = yes

	trigger = {
		has_heir_flag = fee_child_of_destiny
	}

	immediate = {
		hidden_effect = {
			country_event = {
				id = FEE_Child_of_Destiny_Events.4
				days = 730
			}
		}
	}

	option = {
		name = FEE_Child_of_Destiny_Events.3.OPT1

		ai_chance = { factor = 100 }

		custom_tooltip = cod_your_heirs_abilities_keep_growing
	}
}

# A Holy Warrior?
country_event = {
	id = FEE_Child_of_Destiny_Events.4
	title = FEE_Child_of_Destiny_Events.4.T
	desc = FEE_Child_of_Destiny_Events.4.D
	picture = RELIGIOUS_WARS_eventPicture

	is_triggered_only = yes

	trigger = {
		has_heir_flag = fee_child_of_destiny
	}

	immediate = {
		hidden_effect = {
			country_event = {
				id = FEE_Child_of_Destiny_Events.5
				days = 730
			}
		}
	}

	option = {
		name = FEE_Child_of_Destiny_Events.4.OPT1

		ai_chance = { factor = 100 }

		custom_tooltip = cod_your_heirs_abilities_keep_growing
	}
}

# The Cunning General
country_event = {
	id = FEE_Child_of_Destiny_Events.5
	title = FEE_Child_of_Destiny_Events.5.T
	desc = FEE_Child_of_Destiny_Events.5.D
	picture = CONQUEST_eventPicture

	is_triggered_only = yes

	trigger = {
		has_heir_flag = fee_child_of_destiny
	}

	immediate = {
		hidden_effect = {
			country_event = {
				id = FEE_Child_of_Destiny_Events.6
				days = 730
			}
		}
	}

	option = {
		name = FEE_Child_of_Destiny_Events.5.OPT1

		ai_chance = { factor = 100 }

		change_heir_mil = 6
		custom_tooltip = cod_your_heirs_abilities_keep_growing
	}
}

# The Great Ruler
country_event = {
	id = FEE_Child_of_Destiny_Events.6
	title = FEE_Child_of_Destiny_Events.6.T
	desc = FEE_Child_of_Destiny_Events.6.D
	picture = GOOD_WITH_MONARCH_eventPicture

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			country_event = {
				id = FEE_Child_of_Destiny_Events.7
				days = 365
			}
		}
	}

	option = {
		name = FEE_Child_of_Destiny_Events.6.OPT1

		ai_chance = { factor = 100 }

		change_heir_adm = 6
		custom_tooltip = cod_your_heirs_abilities_keep_growing
	}
}

# An Assassination Attempt!
country_event = {
	id = FEE_Child_of_Destiny_Events.7
	title = FEE_Child_of_Destiny_Events.7.T
	desc = FEE_Child_of_Destiny_Events.7.D
	picture = SPY_eventPicture

	is_triggered_only = yes

	trigger = {
		has_heir_flag = fee_child_of_destiny
	}

	immediate = {
		hidden_effect = {
			country_event = {
				id = FEE_Child_of_Destiny_Events.8
				days = 365
			}
		}
	}

	option = {
		name = FEE_Child_of_Destiny_Events.7.OPT1

		ai_chance = { factor = 100 }

		custom_tooltip = cod_your_heirs_abilities_keep_growing
	}
}

# A Hunting Accident?
country_event = {
	id = FEE_Child_of_Destiny_Events.8
	title = FEE_Child_of_Destiny_Events.8.T
	desc = FEE_Child_of_Destiny_Events.8.D
	picture = DEATH_OF_HEIR_eventPicture

	is_triggered_only = yes

	trigger = {
		has_heir_flag = fee_child_of_destiny
	}

	immediate = {
		hidden_effect = {
			country_event = {
				id = FEE_Child_of_Destiny_Events.9
				days = 365
			}
		}
	}

	option = {
		name = FEE_Child_of_Destiny_Events.8.OPT1

		ai_chance = { factor = 100 }

		custom_tooltip = cod_your_heirs_abilities_keep_growing
	}
}

# The Popular Child
country_event = {
	id = FEE_Child_of_Destiny_Events.9
	title = FEE_Child_of_Destiny_Events.9.T
	desc = FEE_Child_of_Destiny_Events.9.D
	picture = ADVISOR_eventPicture

	is_triggered_only = yes

	trigger = {
		has_heir_flag = fee_child_of_destiny
	}

	option = {
		name = FEE_Child_of_Destiny_Events.9.OPT1

		ai_chance = { factor = 100 }

		change_heir_dip = 6
		custom_tooltip = cod_your_heirs_abilities_keep_growing
	}
}

# Child of Destiny
country_event = {
	id = FEE_Child_of_Destiny_Events.10
	title = FEE_Child_of_Destiny_Events.10.T
	desc = FEE_Child_of_Destiny_Events.10.D
	picture = HEIR_EDUCATION_eventPicture

	trigger = {
		has_dlc = "Rights of Man"
		has_heir_flag = fee_child_of_destiny
		heir_age = 14
	}

	option = {
		name = FEE_Child_of_Destiny_Events.10.OPT1

		ai_chance = { factor = 100 }

		tooltip = {
			add_heir_personality = fee_child_of_destiny_personality
		}
	}
}

# The Great Conqueror
country_event = {
	id = FEE_Child_of_Destiny_Events.11
	title = FEE_Child_of_Destiny_Events.11.T
	desc = FEE_Child_of_Destiny_Events.11.D
	picture = HORDE_ON_HORSEBACK_eventPicture

	trigger = {
		has_ruler_flag = fee_child_of_destiny
		NOT = { has_ruler_flag = fee_child_of_destiny_event_2 }
	}

	immediate = {
		hidden_effect = {
			set_ruler_flag = fee_child_of_destiny_event_2
		}
	}

	option = {
		name = FEE_Child_of_Destiny_Events.11.OPT1

		ai_chance = { factor = 100 }

		if = {
			limit = {
				has_dlc = "Rights of Man"
			}
			add_ruler_personality = conqueror_personality
			add_ruler_personality = bold_fighter_personality
		}
		if = {
			limit = {
				is_monarch_leader = no
			}
			define_ruler_to_general = {
				fire = 6
				shock = 6
				manuever = 6
				siege = 6
			#	trait = fee_child_of_destiny_general_modifier not allowed I think
			}
		}
	}
}

# # Hidden Event to set the child of destiny
# country_event = {
# 	id = FEE_Child_of_Destiny_Events.100
# 	title = FEE_Child_of_Destiny_Events.100.T
# 	desc = FEE_Child_of_Destiny_Events.100.D
# 	picture = NEW_HEIR_eventPicture

# 	trigger = {
# 		NOT = { heir_age = 1 }
# 		NOT = { total_development = 150 }
# 		all_countries_including_self = {
# 			NOT = { has_heir_flag = fee_child_of_destiny }
# 			NOT = { has_ruler_flag = fee_child_of_destiny }
# 		}
# 	}

# 	mean_time_to_happen = {
# 		years = 1
# 	}

# 	hidden = yes

# 	immediate = {
# 		hidden_effect = {
# 			random = {
# 				chance = 1
# 				set_heir_flag = fee_child_of_destiny
# 				set_ruler_flag = fee_child_of_destiny
# 			}
# 		}
# 	}

# 	option = {
# 		name = FEE_Child_of_Destiny_Events.100.OPT1
# 		ai_chance = {
# 			factor = 1
# 		}
# 	}
# }