###################################
#
# THE OLD GODS 
# - Defensive pagan events
#
###################################

# Written by Mathilda Bjarnehed & Milla Isaksson

namespace = TOG

###ANCESTOR WORSHIP DECISION EVENTS###

#Make a request
character_event = {
	id = TOG.7000
	desc = EVTDESC_TOG_7000
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_tribal_shrine

	is_triggered_only = yes

	trigger = {
		OR = {
			religion = finnish_pagan
			religion = finnish_pagan_reformed
			religion = west_african_pagan
			religion = west_african_pagan_reformed
			religion = baltic_pagan
			religion = baltic_pagan_reformed
			religion = slavic_pagan
			religion = slavic_pagan_reformed
			religion = tengri_pagan
			religion = tengri_pagan_reformed
			religion = tibetan_pagan
		}
	}

	#Health
	option = {
		name = EVTOPTA_TOG_7000
		
		ai_chance = {
			factor = 100
			
			modifier = {
				factor = 2
				NOT = { health = 3 }
			}
			modifier = {
				factor = 2
				trait = paranoid
			}
		}
		
		trigger = { 
			OR = {
				has_disease_trigger = yes
				trait = ill
				NOT = { health = 4 }
				has_character_flag = developing_illness
			}
		}
		set_character_flag = ancestors_health
		hidden_tooltip = { character_event = { id = TOG.7001 days = 3 } }
	}

	#Relationships - family, friends & love
	option = {
		name = EVTOPTB_TOG_7000
		
		ai_chance = {
			factor = 33
			
			modifier = {
				factor = 2
				trait = kind
			}
			modifier = {
				factor = 2
				trait = gregarious
			}
			modifier = {
				factor = 2
				trait = lustful
			}
			modifier = {
				factor = 2
				trait = socializer
			}
		}
		
		trigger = {	NOT = { trait = cruel } }
		set_character_flag = ancestors_relationships
		hidden_tooltip = { character_event = { id = TOG.7001 days = 3 } }
	}

	#War
	option = {
		name = EVTOPTC_TOG_7000
		
		ai_chance = {
			factor = 33
			
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 2
				is_strong_trigger = yes
			}
			modifier = {
				factor = 2
				trait = ambitious
			}
			modifier = {
				factor = 2
				trait = strategist
			}
		}
		
		trigger = {	NOT = { trait = craven } }
		set_character_flag = ancestors_war
		hidden_tooltip = { character_event = { id = TOG.7001 days = 3 } }
	}

	#Prosperity
	option = {
		name = EVTOPTD_TOG_7000
		
		ai_chance = {
			factor = 33
			
			modifier = {
				factor = 2
				trait = diligent
			}
			modifier = {
				factor = 2
				trait = patient
			}
			modifier = {
				factor = 2
				trait = content
			}
			modifier = {
				factor = 2
				trait = gardener
			}
		}
		
		trigger = {	is_nomadic = no }
		set_character_flag = ancestors_prosperity
		hidden_tooltip = { character_event = { id = TOG.7001 days = 3 } }
	}

	#Wisdom
	option = {
		name = EVTOPTE_TOG_7000
		
		ai_chance = {
			factor = 33
			
			modifier = {
				factor = 2
				trait = erudite
			}
			modifier = {
				factor = 2
				is_smart_trigger = yes
			}
			modifier = {
				factor = 2
				trait = humble
			}
			modifier = {
				factor = 2
				trait = scholar
			}
		}
		
		trigger = {	is_dumb_trigger = no }
		set_character_flag = ancestors_wisdom
		hidden_tooltip = { character_event = { id = TOG.7001 days = 3 } }
	}
}

#Make a Sacrifice
character_event = {
	id = TOG.7001
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_shadowy_cabal

	hide_from = yes

	desc = {
		trigger = { has_character_flag = ancestors_health }
		text = EVTDESC_TOG_7001_health
	}
	desc = {
		trigger = { has_character_flag = ancestors_relationships }
		text = EVTDESC_TOG_7001_relationships
	}
	desc = {
		trigger = { has_character_flag = ancestors_war }
		text = EVTDESC_TOG_7001_war
	}
	desc = {
		trigger = { has_character_flag = ancestors_prosperity }
		text = EVTDESC_TOG_7001_prosperity
	}
	desc = {
		trigger = { has_character_flag = ancestors_wisdom }
		text = EVTDESC_TOG_7001_wisdom
	}

	is_triggered_only = yes

	immediate = {
		random_courtier = {
			limit = { 
				prisoner = yes 
				age = 12
			}
			save_event_target_as = human_sacrifice_prisoner
		}
		random_courtier = {
			limit = {
				prisoner = no
				age = 12
				is_unimportant_trigger = yes
			}
			save_event_target_as = human_sacrifice_courtier
		}
	}

	#Sacrifice limb
	option = {
		name = EVTOPTA_TOG_7001
		custom_tooltip = { text = EVTOPTA_TOG_7001_TOOLTIP }

		piety = 100
		
		ai_chance = {
			factor = 300
			
			modifier = {
				factor = 0
				NOR = {
					trait = zealous
					trait = lunatic
					trait = possessed
				}
			}

			modifier = {
				factor = 0.5
				OR = {
					trait = one_eyed
					trait = blinded
				}
			}
			modifier = {
				factor = 0.5
				trait = one_handed
			}
			modifier = {
				factor = 0.5
				trait = one_legged
			}
			modifier = {
				factor = 0.01
				trait = severely_injured
			}
			modifier = {
				factor = 0.01
				trait = maimed
			}
		}

		trigger = {
			NAND = {
				trait = one_handed
				trait = one_legged
				OR = {
					trait = one_eyed
					trait = blinded
				}
			}
			NOT = { trait = maimed }
		}

		set_character_flag = ancestors_limb

		hidden_tooltip = { character_event = { id = TOG.7002 days = 3 } }

		#Shows the right body part in tooltip
		if = {
			limit = {
				has_dlc = "Reapers"
				NOT = { trait = one_legged }
				OR = {
					trait = one_eyed
					trait = blinded
				}
				trait = one_handed
			}

			tooltip = { 
				add_trait = one_legged 
				add_trait = severely_injured
				resolve_severely_injured_effect = yes
			}

			set_character_flag = ancestors_leg	
		}
		if = {
			limit = {
				has_dlc = "Reapers"
				NOT = { trait = one_handed }
				OR = {
					trait = one_eyed
					trait = blinded
				}	
			}

			tooltip = { 
				add_trait = one_handed
				add_trait = severely_injured
				resolve_severely_injured_effect = yes
			}

			set_character_flag = ancestors_hand
		}
		if = {
			limit = {
				has_dlc = "Reapers"
				NOR = { 
					trait = one_eyed 
					trait = blinded 
				} 
			}
			tooltip = { 
				add_trait = one_eyed
				add_trait = severely_injured
				resolve_severely_injured_effect = yes
			}
			set_character_flag = ancestors_eye
		}
		
		if = {
			limit = {
				NOT = { has_dlc = "Reapers" }
				NOT = { trait = maimed }
			}
			tooltip = { add_trait = maimed }
			set_character_flag = ancestors_maimed
		}
		
	}

	#Sacrifice prisoner
	option = {
		name = EVTOPTB_TOG_7001
		custom_tooltip = { text = EVTOPTB_TOG_7001_TOOLTIP }

		piety = 60
		
		ai_chance = {
			factor = 80
			
			modifier = {
				factor = 2
				trait = cruel
			}
			modifier = {
				factor = 2
				trait = arbitrary
			}
		}

		trigger = { 
			event_target:human_sacrifice_prisoner = { always = yes }
		}

		set_character_flag = ancestors_human

		event_target:human_sacrifice_prisoner = { death = { death_reason = death_sacrificed_ancestors killer = ROOT } }

		event_target:human_sacrifice_prisoner = { save_event_target_as = kinslayer_target }
		add_kinslayer_trait_effect = yes

		hidden_tooltip = { character_event = { id = TOG.7002 days = 3 } }
	}

	#Sacrifice courtier
	option = {
		name = EVTOPTE_TOG_7001
		custom_tooltip = { text = EVTOPTE_TOG_7001_TOOLTIP }

		piety = 60
		
		ai_chance = {
			factor = 80
			
			modifier = {
				factor = 2
				trait = cruel
			}
			modifier = {
				factor = 2
				trait = arbitrary
			}
		}

		trigger = {
			NOT = { event_target:human_sacrifice_prisoner = { always = yes } }
			event_target:human_sacrifice_courtier = { always = yes }
		}

		set_character_flag = ancestors_human

		event_target:human_sacrifice_courtier = { death = { death_reason = death_sacrificed_ancestors killer = ROOT } }

		event_target:human_sacrifice_courtier = { save_event_target_as = kinslayer_target }
		add_kinslayer_trait_effect = yes
		
		hidden_tooltip = { character_event = { id = TOG.7002 days = 3 } }
	}

	#Great feast Sacrifice
	option = {
		name = EVTOPTC_TOG_7001
		custom_tooltip = { text = EVTOPTC_TOG_7001_TOOLTIP }

		piety = 40
		
		ai_chance = {
			factor = 10
			
			modifier = {
				factor = 0.5
				NOT = { trait = greedy }
			}
		}
		
		scaled_wealth = { value = -1 min = -25 }

		hidden_tooltip = { character_event = { id = TOG.7002 days = 3 } }

		set_character_flag = ancestors_feast
	}

	#Minor Sacrifice
	option = {
		name = EVTOPTD_TOG_7001
		custom_tooltip = { text = EVTOPTD_TOG_7001_TOOLTIP }

		piety = 10
		
		ai_chance = {
			factor = 10
			
			modifier = {
				factor = 2
				trait = greedy
			}
		}
		
		treasury = -5

		hidden_tooltip = { character_event = { id = TOG.7002 days = 3 } }

		set_character_flag = ancestors_carving
	}
}

#End of Sacrifice
character_event = {
	id = TOG.7002
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_tribal_shrine

	desc = {
		trigger = { has_character_flag = ancestors_limb }
		text = EVTDESC_TOG_7002_limb
		picture = GFX_evt_torture
	}
	desc = {
		trigger = { has_character_flag = ancestors_human }
		text = EVTDESC_TOG_7002_human
		picture = GFX_evt_torture
	}
	desc = {
		trigger = { has_character_flag = ancestors_feast }
		text = EVTDESC_TOG_7002_feast
	}
	desc = {
		trigger = { has_character_flag = ancestors_carving }
		text = EVTDESC_TOG_7002_carving
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7002

		remove_do_not_disturb_effect = yes

		#REMOVES LIMBS
		if = {
			limit = { has_character_flag = ancestors_eye }
			add_trait = one_eyed
		}
		if = {
			limit = { has_character_flag = ancestors_leg }
			add_trait = one_legged
		}
		if = {
			limit = { has_character_flag = ancestors_hand }
			add_trait = one_handed
		}
		if = {
			limit = { has_character_flag = ancestors_maimed }
			add_trait = maimed
		}

		if = { 
			limit = {
				OR = {
					has_character_flag = ancestors_leg
					has_character_flag = ancestors_hand
					has_character_flag = ancestors_eye
				}
			}
			add_trait = severely_injured
			resolve_severely_injured_effect = yes
		}

		clr_character_flag = ancestors_leg
		clr_character_flag = ancestors_hand
		clr_character_flag = ancestors_eye
		clr_character_flag = ancestors_maimed


		#OUTCOMES

		#Health
		if = { 
			limit = { has_character_flag = ancestors_health }
			

			#Limb
			if = { 
				limit = { has_character_flag = ancestors_limb }

				hidden_tooltip = {
					random_list = { 
						10 = { character_event = { id = TOG.7010 days = 30 } } #Remove disease/blessing of health
						15 = {
							modifier = { factor = 0 is_strong_trigger = yes } #Robust
						 	character_event = { id = TOG.7011 days = 300 } 
						}
						30 = { character_event = { id = TOG.7012 days = 200 } } #Health bonus
						5 = { character_event = { id = TOG.7013 days = 150 } } #Illness
						35 = { } #Nothing
					}
				}
			}
			#Human Sacrifice
			if = { 
				limit = { has_character_flag = ancestors_human }

				hidden_tooltip = {
					random_list = { 
						5 = { character_event = { id = TOG.7010 days = 30 } } #Remove disease/blessing of health
						10 = {
							modifier = { factor = 0 is_strong_trigger = yes } #Robust
						 	character_event = { id = TOG.7011 days = 300 } 
						}
						30 = { character_event = { id = TOG.7012 days = 200 } } #Health bonus
						5 = { character_event = { id = TOG.7013 days = 150 } } #Illness
						30 = { } #Nothing
					}
				}
			}
			#Big gift
			if = { 
				limit = { has_character_flag = ancestors_feast }

				hidden_tooltip = {
					random_list = { 
						1 = { character_event = { id = TOG.7010 days = 30 } } #Remove disease/blessing of health
						1 = {
							modifier = { factor = 0 is_strong_trigger = yes } #Robust
						 	character_event = { id = TOG.7011 days = 300 } 
						}
						50 = { character_event = { id = TOG.7012 days = 200 } } #Health bonus
						10 = { character_event = { id = TOG.7013 days = 150 } } #Illness
						50 = { } #Nothing
					}
				}
			}
			#Small gift
			if = { 
				limit = { has_character_flag = ancestors_carving }

				hidden_tooltip = {
					random_list = { 
						1 = { character_event = { id = TOG.7010 days = 30 } } #Remove disease/blessing of health
						1 = {
							modifier = { factor = 0 is_strong_trigger = yes } #Robust
						 	character_event = { id = TOG.7011 days = 300 } 
						}
						15 = { character_event = { id = TOG.7012 days = 200 } } #Health bonus
						15 = { character_event = { id = TOG.7013 days = 150 } } #Illness
						20 = { } #Nothing
					}
				}
			}	
		}

		#Relationships
		if = { 
			limit = { has_character_flag = ancestors_relationships }
			clr_character_flag = ancestors_relationships

			#Limb
			if = { 
				limit = { has_character_flag = ancestors_limb }

				hidden_tooltip = {
					random_list = { 
						10 = { character_event = { id = TOG.7024 days = 350 } } #Good with people
						15 = { character_event = { id = TOG.7020 days = 100 } } #Lover
						15 = { character_event = { id = TOG.7021 days = 150 } } #Friend
						10 = { character_event = { id = TOG.7022 days = 300 } } #Diplomacy bonus
						10 = { character_event = { id = TOG.7025 days = 100 } } #Cat
						5 = { character_event = { id = TOG.7023 days = 150 } } #Rival
						35 = { } #Nothing
					}
				}
			}
			#Human Sacrifice
			if = { 
				limit = { has_character_flag = ancestors_human }

				hidden_tooltip = {
					random_list = { 
						5 = { character_event = { id = TOG.7024 days = 350 } } #Good with people
						15 = { character_event = { id = TOG.7020 days = 100 } } #Lover
						15 = { character_event = { id = TOG.7021 days = 150 } } #Friend
						10 = { character_event = { id = TOG.7022 days = 300 } } #Diplomacy bonus
						10 = { character_event = { id = TOG.7025 days = 100 } } #Cat
						5 = { character_event = { id = TOG.7023 days = 150 } } #Rival
						35 = { } #Nothing
					}
				}
			}
			#Big gift
			if = { 
				limit = { has_character_flag = ancestors_feast }

				hidden_tooltip = {
					random_list = { 
						1 = { character_event = { id = TOG.7024 days = 350 } } #Good with people
						15 = { character_event = { id = TOG.7020 days = 100 } } #Lover
						15 = { character_event = { id = TOG.7021 days = 150 } } #Friend
						20 = { character_event = { id = TOG.7022 days = 300 } } #Diplomacy bonus
						15 = { character_event = { id = TOG.7025 days = 100 } } #Cat
						10 = { character_event = { id = TOG.7023 days = 150 } } #Rival
						35 = { } #Nothing
					}
				}
			}
			#Small gift
			if = { 
				limit = { has_character_flag = ancestors_carving }

				hidden_tooltip = {
					random_list = { 
						1 = { character_event = { id = TOG.7024 days = 300 } } #Good with people
						5 = { character_event = { id = TOG.7020 days = 100 } } #Lover
						5 = { character_event = { id = TOG.7021 days = 150 } } #Friend
						10 = { character_event = { id = TOG.7022 days = 300 } } #Diplomacy bonus
						20 = { character_event = { id = TOG.7025 days = 100 } } #Cat
						20 = { character_event = { id = TOG.7023 days = 150 } } #Rival
						35 = { } #Nothing
					}
				}
			}	
		}

		#War
		if = { 
			limit = { has_character_flag = ancestors_war }
			clr_character_flag = ancestors_war
			
			#Limb
			if = { 
				limit = { has_character_flag = ancestors_limb }

				hidden_tooltip = {
					random_list = { 
						15 = { character_event = { id = TOG.7035 days = 150 } } #Increased levy
						25 = { character_event = { id = TOG.7034 days = 100 } } #War tech
						25 = { character_event = { id = TOG.7030 days = 100 } } #Commander
						15 = { 				
							modifier = { factor = 0 is_strong_trigger = yes } #Robust
							character_event = { id = TOG.7011 days = 360 } 
						}
						10 = { 
							modifier = { factor = 0 can_have_more_leadership_traits = no } #Leadership trait
							character_event = { id = TOG.7032 days = 360 }
						}
						5 = { character_event = { id = TOG.7033 days = 100 } } #Maimed
						35 = { } #Nothing
					}
				}
			}
			#Human Sacrifice
			if = { 
				limit = { has_character_flag = ancestors_human }

				hidden_tooltip = {
					random_list = { 
						10 = { character_event = { id = TOG.7035 days = 150 } } #Increased levy
						20 = { character_event = { id = TOG.7034 days = 100 } } #War tech
						20 = { character_event = { id = TOG.7030 days = 100 } } #Commander
						10 = { 				
							modifier = { factor = 0 is_strong_trigger = yes } #Robust
							character_event = { id = TOG.7011 days = 360 } 
						}
						10 = { 
							modifier = { factor = 0 can_have_more_leadership_traits = no } #Leadership trait
							character_event = { id = TOG.7032 days = 360 }
						}
						5 = { character_event = { id = TOG.7033 days = 100 } } #Maimed
						35 = { } #Nothing
					}
				}
			}
			#Big gift
			if = { 
				limit = { has_character_flag = ancestors_feast }

				hidden_tooltip = {
					random_list = { 
						5 = { character_event = { id = TOG.7035 days = 150 } } #Increased levy
						10 = { character_event = { id = TOG.7034 days = 100 } } #War tech
						10 = { character_event = { id = TOG.7030 days = 100 } } #Commander
						5 = { 				
							modifier = { factor = 0 is_strong_trigger = yes } #Robust
							character_event = { id = TOG.7011 days = 360 } 
						}
						20 = { 
							modifier = { factor = 0 can_have_more_leadership_traits = no } #Leadership trait
							character_event = { id = TOG.7032 days = 360 }
						}
						10 = { character_event = { id = TOG.7033 days = 100 } } #Maimed
						35 = { } #Nothing
					}
				}
			}
			#Small gift
			if = { 
				limit = { has_character_flag = ancestors_carving }

				hidden_tooltip = {
					random_list = { 
						1 = { character_event = { id = TOG.7035 days = 150 } } #Increased levy
						5 = { character_event = { id = TOG.7034 days = 100 } } #War tech
						5 = { character_event = { id = TOG.7030 days = 100 } } #Commander
						5 = { 				
							modifier = { factor = 0 is_strong_trigger = yes } #Robust
							character_event = { id = TOG.7011 days = 360 } 
						}
						15 = { 
							modifier = { factor = 0 can_have_more_leadership_traits = no } #Leadership trait
							character_event = { id = TOG.7032 days = 360 }
						}
						15 = { character_event = { id = TOG.7033 days = 100 } } #Maimed
						35 = { } #Nothing
					}
				}
			}	
		}

		#Prosperity
		if = { 
			limit = { has_character_flag = ancestors_prosperity }
			
			#Limb
			if = { 
				limit = { has_character_flag = ancestors_limb }

				hidden_tooltip = {
					random_list = { 
						1 = { 
							if = {
								limit = {
									capital_scope = {
										NOR = { 
											has_province_modifier = depopulated_1
											has_province_modifier = depopulated_2
											has_province_modifier = depopulated_3
										}
									}
								}
								character_event = { id = TOG.7040 days = 500 } #Increase prosperity level
							}
							if = {
								limit = {
									capital_scope = {
										OR = { 
											has_province_modifier = depopulated_1
											has_province_modifier = depopulated_2
											has_province_modifier = depopulated_3
										}
									}
								}
								character_event = { id = TOG.7044 days = 500 } #Decrease depopulation level
							}	 
						} 
						15 = { character_event = { id = TOG.7041 days = 100 } } #Economy tech points
						10 = { character_event = { id = TOG.7042 days = 200 } } #Stewardship bonus
						5 = { character_event = { id = TOG.7043 days = 300 } } #Less tax
						20 = { } #Nothing
					}
				}
			}
			#Human Sacrifice
			if = { 
				limit = { has_character_flag = ancestors_human }

				hidden_tooltip = {
					random_list = { 
						5 = { 
							if = {
								limit = {
									capital_scope = {
										NOR = { 
											has_province_modifier = depopulated_1
											has_province_modifier = depopulated_2
											has_province_modifier = depopulated_3
										}
									}
								}
								character_event = { id = TOG.7040 days = 500 } #Increase prosperity level
							}
							if = {
								limit = {
									capital_scope = {
										OR = { 
											has_province_modifier = depopulated_1
											has_province_modifier = depopulated_2
											has_province_modifier = depopulated_3
										}
									}
								}
								character_event = { id = TOG.7044 days = 500 } #Decrease depopulation level
							}	 
						}
						15 = { character_event = { id = TOG.7041 days = 100 } } #Economy tech points
						15 = { character_event = { id = TOG.7042 days = 200 } } #Stewardship bonus
						5 = { character_event = { id = TOG.7043 days = 300 } } #Less tax
						35 = { } #Nothing
					}
				}
			}
			#Big gift
			if = { 
				limit = { has_character_flag = ancestors_feast }

				hidden_tooltip = {
					random_list = { 
						5 = { 
							if = {
								limit = {
									capital_scope = {
										NOR = { 
											has_province_modifier = depopulated_1
											has_province_modifier = depopulated_2
											has_province_modifier = depopulated_3
										}
									}
								}
								character_event = { id = TOG.7040 days = 500 } #Increase prosperity level
							}
							if = {
								limit = {
									capital_scope = {
										OR = { 
											has_province_modifier = depopulated_1
											has_province_modifier = depopulated_2
											has_province_modifier = depopulated_3
										}
									}
								}
								character_event = { id = TOG.7044 days = 500 } #Decrease depopulation level
							}	 
						}
						15 = { character_event = { id = TOG.7041 days = 100 } } #Economy tech points
						15 = { character_event = { id = TOG.7042 days = 200 } } #Stewardship bonus
						10 = { character_event = { id = TOG.7043 days = 300 } } #Less tax
						35 = { } #Nothing
					}
				}
			}
			#Small gift
			if = { 
				limit = { has_character_flag = ancestors_carving }

				hidden_tooltip = {
					random_list = { 
						1 = { 
							if = {
								limit = {
									capital_scope = {
										NOR = { 
											has_province_modifier = depopulated_1
											has_province_modifier = depopulated_2
											has_province_modifier = depopulated_3
										}
									}
								}
								character_event = { id = TOG.7040 days = 500 } #Increase prosperity level
							}
							if = {
								limit = {
									capital_scope = {
										OR = { 
											has_province_modifier = depopulated_1
											has_province_modifier = depopulated_2
											has_province_modifier = depopulated_3
										}
									}
								}
								character_event = { id = TOG.7044 days = 500 } #Decrease depopulation level
							}	 
						}
						5 = { character_event = { id = TOG.7041 days = 100 } } #Economy tech points
						10 = { character_event = { id = TOG.7042 days = 200 } } #Stewardship bonus
						10 = { character_event = { id = TOG.7043 days = 300 } } #Less tax
						20 = { } #Nothing
					}
				}
			}	
		}

		#Wisdom
		if = { 
			limit = { has_character_flag = ancestors_wisdom }
			
			#Limb
			if = { 
				limit = { has_character_flag = ancestors_limb }

				hidden_tooltip = {
					random_list = { 
						10 = { 
							modifier = { factor = 0 is_smart_trigger = yes } #Shrewd
							character_event = { id = TOG.7050 days = 400 }
						}
						15 = { character_event = { id = TOG.7051 days = 200 } } #Wise woman
						15 = { character_event = { id = TOG.7054 days = 300 } } #Owl
						5 = { character_event = { id = TOG.7052 days = 300 } } #Learning bonus
						3 = { 
							modifier = { factor = 0 is_dumb_trigger = yes } #Dull
							character_event = { id = TOG.7053 days = 200 } 
						}
						20 = { } #Nothing
					}
				}
			}
			#Human Sacrifice
			if = { 
				limit = { has_character_flag = ancestors_human }

				hidden_tooltip = {
					random_list = { 
						5 = { 
							modifier = { factor = 0 is_smart_trigger = yes } #Shrewd
							character_event = { id = TOG.7050 days = 400 }
						}
						15 = { character_event = { id = TOG.7051 days = 200 } } #Wise woman
						15 = { character_event = { id = TOG.7054 days = 300 } } #Owl
						10 = { character_event = { id = TOG.7052 days = 300 } } #Learning bonus
						5 = { 
							modifier = { factor = 0 is_dumb_trigger = yes } #Dull
							character_event = { id = TOG.7053 days = 200 } 
						}
						35 = { } #Nothing
					}
				}
			}
			#Big gift
			if = { 
				limit = { has_character_flag = ancestors_feast }

				hidden_tooltip = {
					random_list = { 
						1 = { 
							modifier = { factor = 0 is_smart_trigger = yes } #Shrewd
							character_event = { id = TOG.7050 days = 400 }
						}
						15 = { character_event = { id = TOG.7051 days = 200 } } #Wise woman
						15 = { character_event = { id = TOG.7054 days = 300 } } #Owl
						20 = { character_event = { id = TOG.7052 days = 300 } } #Learning bonus
						10 = { 
							modifier = { factor = 0 is_dumb_trigger = yes } #Dull
							character_event = { id = TOG.7053 days = 200 } 
						}
						35 = { } #Nothing
					}
				}
			}
			#Small gift
			if = { 
				limit = { has_character_flag = ancestors_carving }

				hidden_tooltip = {
					random_list = { 
						1 = { 
							modifier = { factor = 0 is_smart_trigger = yes } #Shrewd
							character_event = { id = TOG.7050 days = 400 }
						}
						5 = { character_event = { id = TOG.7051 days = 200 } } #Wise woman
						5 = { character_event = { id = TOG.7054 days = 300 } } #Owl
						10 = { character_event = { id = TOG.7052 days = 300 } } #Learning bonus
						10 = { 
							modifier = { factor = 0 is_dumb_trigger = yes } #Dull
							character_event = { id = TOG.7053 days = 200 } 
						}
						20 = { } #Nothing
					}
				}
			}
		}
		clr_character_flag = ancestors_health
		clr_character_flag = ancestors_relationships
		clr_character_flag = ancestors_war
		clr_character_flag = ancestors_prosperity
		clr_character_flag = ancestors_wisdom
		clr_character_flag = ancestors_limb
		clr_character_flag = ancestors_human
		clr_character_flag = ancestors_feast
		clr_character_flag = ancestors_carving
	}
}

#HEALTH OUTCOMES

#Get healed or blessing of health?
character_event = {
	id = TOG.7010
	
	is_triggered_only = yes
	hide_window = yes

	option = {
		if = {
			limit = { 
				has_disease_trigger = no
			}
			character_event = { id = TOG.7014 }
		}
		if = {
			limit = { 
				has_disease_trigger = yes
			}
			character_event = { id = TOG.7016 }
		}
	}
}

#Blessing of health
character_event = {
	id = TOG.7014
	desc = EVTDESC_TOG_7014
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_tribal_shrine

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7014
		set_character_flag = old_gods_blessing
		add_character_modifier = {
			name = blessing_of_health
			duration = -1
		}
	}
}

#Blessing of health healing illness
character_event = {
	id = TOG.7015
	desc = EVTDESC_TOG_7015
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_tribal_shrine

	is_triggered_only = yes

	trigger = {
		has_disease_trigger = yes
	}

	option = {
		name = EVTOPTA_TOG_7015
		remove_disease_trait_effect = yes	
		remove_character_modifier = blessing_of_health

		if = {
			limit = { trait = cynical }
			remove_trait = cynical
		}
		if = {
			limit = { NOT = { trait = zealous } }
			add_trait = zealous
		}
		clr_character_flag = old_gods_blessing
	}
}

#Healing illness
character_event = {
	id = TOG.7016
	desc = EVTDESC_TOG_7016
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_tribal_shrine

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7016
		remove_disease_trait_effect = yes	
	}
}


#Robust
character_event = {
	id = TOG.7011
	desc = EVTDESC_TOG_7011
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_tribal_shrine

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7011

		add_trait = robust

		if = {
			limit = { trait = weak }
			remove_trait = weak
		}
		if = {
			limit = { trait = feeble }
			remove_trait = feeble
		}
	}
}

#Small health bonus
character_event = {
	id = TOG.7012
	desc = EVTDESC_TOG_7012
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_tribal_shrine

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7012
		add_character_modifier = {
			name = invigorated
			years = 10
		}
	}
}

#Illness
character_event = {
	id = TOG.7013
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_illness

	desc = {
		trigger = { has_dlc = "Reapers" }
		text = EVTDESC_TOG_7013
		picture = GFX_evt_doctor_tending_to_sick
	}
	desc = {
		trigger = { NOT = { has_dlc = "Reapers" } }
		text = EVTDESC_TOG_7013
		picture = GFX_evt_illness
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7013
		hidden_tooltip = { character_event = { id = 6063 days = 20 } }
	}
}


#RELATIONSHIPS

#Lover
character_event = {
	id = TOG.7020
	desc = EVTDESC_TOG_7020
	border = GFX_event_normal_frame_diplomacy
	picture = GFX_evt_lovers

	is_triggered_only = yes

	immediate = {
		#Targets male lover
		if = {
			limit = { prefers_men_trigger = yes }

			#Grabs random courtier
			if = {
				limit = {
					any_courtier = {
						is_adult = yes
						is_female = no
						NOT = { is_lover = ROOT }
						NOT = { is_close_relative = ROOT }
						OR = {
							AND = {
								same_sex = ROOT
								trait = homosexual
							}
							AND = {
								is_opposite_sex = ROOT
								NOT = { trait = homosexual }
							}
						}
						ai = yes
						prisoner = no
						NOT = { trait = incapable }
					}
				}

				random_courtier = {
					limit = { 
						is_adult = yes
						is_female = no
						NOT = { is_lover = ROOT }
						NOT = { is_close_relative = ROOT }
						OR = {
							AND = {
								same_sex = ROOT
								trait = homosexual
							}
							AND = {
								is_opposite_sex = ROOT
								NOT = { trait = homosexual }
							}
						}
						ai = yes
						prisoner = no
						NOT = { trait = incapable }
					}
					save_event_target_as = ancestors_lover
					break = yes
				}
			}

			#Or creates a new one			
			create_character = {
				female = no
				random_traits = yes
				dynasty = none
			}
			new_character = {
				save_event_target_as = ancestors_lover
				if = {
					limit = { same_sex = ROOT }
					add_trait = homosexual
				}
			}			
		}

		#Targets female lover
		if = {
			limit = { prefers_men_trigger = no }

			#Grabs random courtier
			if = {
				limit = {
					any_courtier = {
						is_adult = yes
						is_female = yes
						NOT = { is_lover = ROOT }
						NOT = { is_close_relative = ROOT }
						OR = {
							AND = {
								same_sex = ROOT
								trait = homosexual
							}
							AND = {
								is_opposite_sex = ROOT
								NOT = { trait = homosexual }
							}
						}
						ai = yes
						prisoner = no
						NOT = { trait = incapable }
					}
				}

				random_courtier = {
					limit = { 
						is_adult = yes
						is_female = yes
						NOT = { is_lover = ROOT }
						NOT = { is_close_relative = ROOT }
						OR = {
							AND = {
								same_sex = ROOT
								trait = homosexual
							}
							AND = {
								is_opposite_sex = ROOT
								NOT = { trait = homosexual }
							}
						}
						ai = yes
						prisoner = no
						NOT = { trait = incapable }
					}
					save_event_target_as = ancestors_lover
					break = yes
				}
			}

			#Or creates a new one			
			create_character = {
				female = yes
				random_traits = yes
				dynasty = none
			}
			new_character = {
				save_event_target_as = ancestors_lover
				if = {
					limit = { same_sex = ROOT }
					add_trait = homosexual
				}
			}			
		}
	}

	#Confess
	option = {
		name = EVTOPTA_TOG_7020

		add_lover = event_target:ancestors_lover
		#chance of impregnation
		hidden_tooltip = {			
			if = {
				limit = {
					ROOT = { is_female = no }
					event_target:ancestors_lover = { is_female = yes } 
				}
				random = {
					chance = 50 
					impregnate = event_target:ancestors_lover
				}
			}
			if = {
				limit = {
					ROOT = { is_female = yes }
					event_target:ancestors_lover = { is_female = no } 
				}
				random = {
					chance = 50 
					event_target:ancestors_lover = { impregnate = ROOT }
				}
			}
		}
	}

	#Or don't
	option = {
		name = EVTOPTB_TOG_7020
		
		ai_chance = {
			factor = 0
		}
	}
}

#Friend
character_event = {
	id = TOG.7021
	desc = EVTDESC_TOG_7021
	border = GFX_event_normal_frame_diplomacy
	picture = GFX_evt_feast

	is_triggered_only = yes

	immediate = {
		#Target a friend
		if = {
			limit = { any_courtier = { NOR = { is_friend = ROOT is_rival = ROOT is_lover = ROOT } } }

			random_courtier = {
				limit = { NOR = { is_friend = ROOT is_rival = ROOT is_lover = ROOT } } 
				save_event_target_as = ancestors_friend
			}
		}

		#Or create new one
		if = {
			limit = { NOT = { any_courtier = { NOR = { is_friend = ROOT is_rival = ROOT is_lover = ROOT } } } }

			create_character = {
				random_traits = yes
				dynasty = random
			}
			new_character = {
				save_event_target_as = ancestors_friend
			}
		}
	}

	#Make friend
	option = {
		name = EVTOPTA_TOG_7021
		add_friend = event_target:ancestors_friend
	}
	option = {
		name = EVTOPTB_TOG_7021
		ai_chance = {
			factor = 0
		}
	}
}

#Small diplomacy bonus
character_event = {
	id = TOG.7022
	desc = EVTDESC_TOG_7022
	border = GFX_event_normal_frame_diplomacy
	picture = GFX_evt_courtiers_talking

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7022

		add_character_modifier = {
			name = good_listener
			years = 10
		}
	}
}

#Rival
character_event = {
	id = TOG.7023
	desc = EVTDESC_TOG_7023
	border = GFX_event_normal_frame_diplomacy
	picture = GFX_evt_tribal_shrine

	is_triggered_only = yes

	immediate = {
		#Target a rival
		if = {
			limit = { any_courtier = { NOR = { is_friend = ROOT is_rival = ROOT is_lover = ROOT } } }

			random_courtier = {
				limit = { NOR = { is_friend = ROOT is_rival = ROOT is_lover = ROOT } } 
				save_event_target_as = ancestors_rival
			}
		}

		#Or create new one
		if = {
			limit = { NOT = { any_courtier = { NOR = { is_friend = ROOT is_rival = ROOT is_lover = ROOT } } } }

			create_character = {
				random_traits = yes
				dynasty = random
			}
			new_character = {
				save_event_target_as = ancestors_rival
			}
		}
	}

	option = {
		name = EVTOPTA_TOG_7023
		add_rival = event_target:ancestors_rival
	}
}

#Good with people
character_event = {
	id = TOG.7024
	desc = EVTDESC_TOG_7024
	border = GFX_event_normal_frame_diplomacy
	picture = GFX_evt_courtiers_talking

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7024
		add_character_modifier = {
			name = respected_by_the_people
			duration = -1
		}
	}
}

#Get a cat
character_event = {
	id = TOG.7025
	border = GFX_event_normal_frame_diplomacy
	picture = GFX_evt_recovery

	desc = {
		trigger = { has_dlc = "Reapers" }
		text = EVTDESC_TOG_7025
		picture = GFX_evt_cat
	}
	desc = {
		trigger = { NOT = { has_dlc = "Reapers" } } 
		text = EVTDESC_TOG_7025
		picture = GFX_evt_recovery
	}


	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7025
		add_cat_effect = yes
	}

	option = {
		name = EVTOPTB_TOG_7025
		
		ai_chance = {
			factor = 0
		}
		
		add_character_modifier = {
			name = bad_person
			years = 1
		}
	}
}


#WAR

#Brilliant commander appears
character_event = {
	id = TOG.7030
	desc = EVTDESC_TOG_7030
	border = GFX_event_normal_frame_war
	picture = GFX_evt_melee

	is_triggered_only = yes

	immediate = {
		if = { 
			limit = {
				OR = { 
					has_law = female_council_law_3
					has_law = female_council_law_4
					has_game_rule = {
						name = gender
						value = all
					}
					has_game_rule = {
						name = gender
						value = plus
					}
				}
			}

			create_character = {
				female = yes
				age = 35
				random_traits = yes
				trait = strong
				trait = brave
				trait = brilliant_strategist
				trait = holy_warrior
			}
			new_character = {
				remove_trait = feeble
				remove_trait = weak
				remove_trait = craven
				remove_trait = imbecile
				remove_trait = slow
				remove_trait = dull
				save_event_target_as = ancestors_commander
			}
		}
		if = { 
			limit = {
				NOR = { 
					religion = cathar
					religion = messalian
					has_law = female_council_law_3
					has_law = female_council_law_4
					has_game_rule = {
						name = gender
						value = all
					}
					has_game_rule = {
						name = gender
						value = plus
					}
				}
			}

			create_character = {
				female = no
				age = 35
				random_traits = yes
				trait = strong
				trait = brave
				trait = brilliant_strategist
				trait = holy_warrior
			}
			new_character = {
				remove_trait = feeble
				remove_trait = weak
				remove_trait = craven
				remove_trait = imbecile
				remove_trait = slow
				remove_trait = dull
				save_event_target_as = ancestors_commander
			}
		}
	}

	option = {
		name = EVTOPTA_TOG_7030

		event_target:ancestors_commander = {
			opinion = {
				modifier = opinion_loyal_servant
				who = ROOT
				months = 1200
			}
		}
	}
}

#Robust is TOG.7011

#Random leadership trait
character_event = {
	id = TOG.7032
	desc = EVTDESC_TOG_7032
	border = GFX_event_normal_frame_war
	picture = GFX_evt_battle

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7032

		random_list = {
			10 = {
				modifier = {
					factor = 0
					trait = light_foot_leader
				}
				add_trait = light_foot_leader
			}
			10 = {
				modifier = {
					factor = 0
					trait = heavy_infantry_leader
				}
				add_trait = heavy_infantry_leader
			}
			10 = {
				modifier = {
					factor = 0
					trait = cavalry_leader
				}
				add_trait = cavalry_leader
			}
			10 = {
				modifier = {
					factor = 0
					trait = inspiring_leader
				}
				add_trait = inspiring_leader
			}
			10 = {
				modifier = {
					factor = 0
					trait = defensive_leader
				}
				add_trait = defensive_leader
			}
			10 = {
				modifier = {
					factor = 0
					trait = flanker
				}
				add_trait = flanker
			}
			10 = {
				modifier = {
					factor = 0
					trait = siege_leader
				}
				add_trait = siege_leader
			}
		}
	}
}

#Maimed while practising swordfighting
character_event = {
	id = TOG.7033
	desc = EVTDESC_TOG_7033
	border = GFX_event_normal_frame_war
	picture = GFX_evt_bloody_man

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7033

		add_maimed_trait_effect = yes
	}
}

#War tech
character_event = {
	id = TOG.7034
	border = GFX_event_normal_frame_war
	picture = GFX_evt_large_army

	desc = {
		trigger = { job_marshal = { always = yes } }
		text = EVTDESC_TOG_7034_A
	}
	desc = {
		trigger = { NOT = { job_marshal = { always = yes } } }
		text = EVTDESC_TOG_7034_B
	}

	immediate = { job_marshal = { save_event_target_as = ancestors_marshal } }

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7034

		military_techpoints = 100	
	}
}

#Levy reinforcement
character_event = {
	id = TOG.7035
	desc = EVTDESC_TOG_7035
	border = GFX_event_normal_frame_war
	picture = GFX_evt_large_army

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7035

		capital_scope = {
			add_province_modifier = {
				name = inspired_warriors
				years = 10
			}
		}
	}
}



#PROSPERITY

#Increase prosperity level of capital
character_event = {
	id = TOG.7040
	desc = EVTDESC_TOG_7040
	border = GFX_event_normal_frame_economy
	picture = GFX_evt_tribal_lands

	is_triggered_only = yes

	trigger = {
		capital_scope = {
			NOR = {
				has_province_modifier = depopulated_1
				has_province_modifier = depopulated_2
				has_province_modifier = depopulated_3
			}
		}
	}

	option = {
		name = EVTOPTA_TOG_7040

		if = {
			limit = { 
				has_dlc = "Reapers" 
				NOT = { capital_scope = { has_province_modifier = prosperity_modifier_3 } }
			}
			capital_scope = { increase_prosperity_effect = yes }
		}

		if = {
			limit = { 
				OR = {
					NOT = { has_dlc = "Reapers" } 
					capital_scope = { has_province_modifier = prosperity_modifier_3 }
				}
			}
			scaled_wealth = { value = 1 min = 50 }
		}
	}
}

#Give economy tech
character_event = {
	id = TOG.7041
	border = GFX_event_normal_frame_economy
	picture = GFX_evt_council

	desc = {
		trigger = { job_treasurer = { always = yes } }
		text = EVTDESC_TOG_7041_A
	}
	desc = {
		trigger = { NOT = { job_treasurer = { always = yes } } }
		text = EVTDESC_TOG_7041_B
	}
	
	hide_from = yes
	
	immediate = { job_treasurer = { save_event_target_as = ancestors_treasurer } }

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7041
		economy_techpoints = 100
	}
}


#Small stewardship bonus
character_event = {
	id = TOG.7042
	desc = EVTDESC_TOG_7042
	border = GFX_event_normal_frame_economy
	picture = GFX_evt_market

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7042

		add_character_modifier = {
			name = bargainer
			years = 10
		}
	}
}

#Bad tax modifier
character_event = {
	id = TOG.7043
	desc = EVTDESC_TOG_7043
	border = GFX_event_normal_frame_economy
	picture = GFX_evt_tribal_shrine

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7043

		add_character_modifier = {
			name = overtaxed_subjects
			years = 5
		}
	}
}

#Decrease depopulation
character_event = {
	id = TOG.7044
	desc = EVTDESC_TOG_7044
	border = GFX_event_normal_frame_economy
	picture = GFX_evt_tribal_lands

	is_triggered_only = yes

	trigger = {
		capital_scope = {
			OR = {
				has_province_modifier = depopulated_1
				has_province_modifier = depopulated_2
				has_province_modifier = depopulated_3
			}
		}
	}

	option = {
		name = EVTOPTA_TOG_7044

		capital_scope = {

			if = {
				limit = { has_province_modifier = depopulated_1 }

				remove_province_modifier = depopulated_1
				break = yes
			}
				
			if = {
				limit = { has_province_modifier = depopulated_2 }

				remove_province_modifier = depopulated_2
				add_province_modifier = { name = depopulated_1 duration = -1 }
				break = yes
			}

			if = {
				limit = { has_province_modifier = depopulated_3 }

				remove_province_modifier = depopulated_3
				add_province_modifier = { name = depopulated_2 duration = -1 }
				break = yes
			}
		}
	}
}

#WISDOM

#Shrewd
character_event = {
	id = TOG.7050
	desc = EVTDESC_TOG_7050
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_library

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7050
		add_trait = shrewd

		if = {
			limit = { trait = dull }
			remove_trait = dull 
		}
		if = {
			limit = { trait = imbecile }
			remove_trait = imbecile 
		}
		if = {
			limit = { trait = slow }
			remove_trait = slow 
		}
	}
}

#Wise woman joins court
character_event = {
	id = TOG.7051
	desc = EVTDESC_TOG_7051
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_tribal_shrine

	is_triggered_only = yes

	immediate = {
		create_character = {
			religion = ROOT
			age = 32
			female = yes
			random_traits = yes
			dynasty = none
			trait = mystic
			trait = genius
			trait = mastermind_theologian
		}
		new_character = {
			remove_trait = dull
			remove_trait = imbecile
			save_event_target_as = ancestors_wise_woman
		}
	}

	option = {
		name = EVTOPTA_TOG_7051

		event_target:ancestors_wise_woman = {
			opinion = {
				modifier = opinion_loyal_servant
				who = ROOT
				months = 1200
			}
		}
	}
}

#Small learning bonus
character_event = {
	id = TOG.7052
	desc = EVTDESC_TOG_7052
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_library

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7052
		add_character_modifier = {
			name = new_insights
			years = 10
		}
	}
}

#Dull
character_event = {
	id = TOG.7053
	desc = EVTDESC_TOG_7053
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_library

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7053

		if = {
			limit = { is_smart_trigger = no }
			add_trait = dull
		}
		if = {
			limit = { trait = genius }
			add_trait = dull
		}
		if = {
			limit = { trait = quick }
			add_trait = dull
		}
		if = {
			limit = { trait = shrewd }
			remove_trait = shrewd 
		}
	}
}

#Get an owl
character_event = {
	id = TOG.7054
	desc = EVTDESC_TOG_7054
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_falconing

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7054
		add_character_modifier = {
			name = pet_owl
			duration = -1
		}
		hidden_tooltip = { character_event = { id = 77800 days = 3500 random = 2000 } } # Owl dies
	}

	option = {
		name = EVTOPTB_TOG_7054
		
		ai_chance = {
			factor = 0
		}
	}
}


###MAIN DEITY EVENTS###

#Main deity event sender
character_event = {
	id = TOG.7100

	is_triggered_only = yes
	hide_window = yes

	trigger = {
		has_minor_deity_trigger = yes
	}

	immediate = {

		random_list = {
			#Stat events
			20 = {
				#Diplomacy Dieties
				if = {
					limit = {
						NOT = { diplomacy = 15 }
						OR = {
							has_character_modifier = follower_of_dievas
							has_character_modifier = follower_of_akka
							has_character_modifier = follower_of_yemoja
						}
					}
					character_event = { id = TOG.7500 }
				}
				#Martial Dieties
				if = {
					limit = {
						NOT = { martial = 15 }
						OR = {
							has_character_modifier = follower_of_perkunas
							has_character_modifier = follower_of_taipo_and_mielikki
							has_character_modifier = follower_of_shango
							has_character_modifier = follower_of_perun
						}
					}
					character_event = { id = TOG.7501 }
				}
				#Stewardship Dieties
				if = {
					limit = {
						NOT = { stewardship = 15 }
						OR = {
							has_character_modifier = follower_of_zemyna
							has_character_modifier = follower_of_ukko
							has_character_modifier = follower_of_ekwensu
							has_character_modifier = follower_of_jarilo
						}
					}
					character_event = { id = TOG.7502 }
				}
				#Intrigue Dieties
				if = {
					limit = {
						NOT = { intrigue = 15 }
						OR = {
							has_character_modifier = follower_of_velnias
							has_character_modifier = follower_of_lempo
							has_character_modifier = follower_of_veles
						}
					}
					character_event = { id = TOG.7503 }
				}
				#Learning Dieties
				if = {
					limit = {
						NOT = { learning = 15 }
						OR = {
							has_character_modifier = follower_of_orunmila
							has_character_modifier = follower_of_morana
						}
					}
					character_event = { id = TOG.7504 }
				}
			}
			#Friendship events
			15 = {
				random_courtier_or_vassal = {
					limit = {
						ai = yes
						NOR = {
							is_friend = ROOT
							is_lover = ROOT
							is_rival = ROOT
						}
						OR = {
							AND = {
								has_character_modifier = follower_of_perun
								ROOT = { has_character_modifier = follower_of_perun }
							}
							AND = {
								has_character_modifier = follower_of_ukko
								ROOT = { has_character_modifier = follower_of_ukko }
							}
							AND = {
								has_character_modifier = follower_of_perkunas
								ROOT = { has_character_modifier = follower_of_perkunas }
							}
							AND = {
								has_character_modifier = follower_of_shango
								ROOT = { has_character_modifier = follower_of_shango }
							}
							AND = {
								has_character_modifier = follower_of_veles
								ROOT = { has_character_modifier = follower_of_veles }
							}
							AND = {
								has_character_modifier = follower_of_jarilo
								ROOT = { has_character_modifier = follower_of_jarilo }
							}
							AND = {
								has_character_modifier = follower_of_morana
								ROOT = { has_character_modifier = follower_of_morana }
							}
							AND = {
								has_character_modifier = follower_of_yemoja
								ROOT = { has_character_modifier = follower_of_yemoja }
							}
							AND = {
								has_character_modifier = follower_of_ekwensu
								ROOT = { has_character_modifier = follower_of_ekwensu }
							}
							AND = {
								has_character_modifier = follower_of_orunmila
								ROOT = { has_character_modifier = follower_of_orunmila }
							}
							AND = {
								has_character_modifier = follower_of_akka
								ROOT = { has_character_modifier = follower_of_akka }
							}
							AND = {
								has_character_modifier = follower_of_taipo_and_mielikki
								ROOT = { has_character_modifier = follower_of_taipo_and_mielikki }
							}
							AND = {
								has_character_modifier = follower_of_lempo
								ROOT = { has_character_modifier = follower_of_lempo }
							}
							AND = {
								has_character_modifier = follower_of_dievas
								ROOT = { has_character_modifier = follower_of_dievas }
							}
							AND = {
								has_character_modifier = follower_of_velnias
								ROOT = { has_character_modifier = follower_of_velnias }
							}
							AND = {
								has_character_modifier = follower_of_zemyna
								ROOT = { has_character_modifier = follower_of_zemyna }
							}
						}
					}
					character_event = { id = TOG.7505 }
				}
			}
			#Theme events set 1
			15 = {
				#Thunder deities
				if = {
					limit = {
						OR = {
							has_character_modifier = follower_of_perun
							has_character_modifier = follower_of_ukko
							has_character_modifier = follower_of_perkunas
							has_character_modifier = follower_of_shango
						}
					}
					random_spouse = {
						limit = { 
							NOT = { trait = brave } 
							ai = yes
							NOT = { has_character_flag = scared_of_thunder }
						}
						save_event_target_as = thunder_target
					}
					random_lover = {
						limit = { 
							NOT = { trait = brave } 
							ai = yes
							NOT = { has_character_flag = scared_of_thunder }
						}
						save_event_target_as = thunder_target
					}
					random_ward = {
						limit = { 
							NOT = { trait = brave } 
							NOT = { trait = willful }
							NOT = { has_character_flag = scared_of_thunder } 
						}
						save_event_target_as = thunder_target
					}
					random_child = {
						limit = { 
							is_adult = no
							NOT = { trait = willful } 
							NOT = { trait = brave }
							NOT = { has_character_flag = scared_of_thunder }
						}
						save_event_target_as = thunder_target
					}
					current_heir = {
						if = {
							limit = { 
								is_adult = no 
								NOT = { trait = willful } 
								NOT = { trait = brave }
								NOT = { has_character_flag = scared_of_thunder }
							}
							save_event_target_as = thunder_target
						}
					}
					event_target:thunder_target = { character_event = { id = TOG.7507 } }
				}
				#Sexy deities
				if = {
					limit = {
						OR = {
							has_character_modifier = follower_of_lempo
							has_character_modifier = follower_of_jarilo
						}
					}
					random_courtier_or_vassal = {
						limit = {
							NOT = { is_close_relative = ROOT }
							ai = yes
							root_attraction_trigger = yes
							is_adult = yes
						}
						save_event_target_as = pagan_lover
					}
					random_courtier_or_vassal = {
						limit = {
							NOT = { is_close_relative = ROOT }
							ai = yes
							root_attraction_trigger = yes
							is_adult = yes
							OR = {
								trait = lustful
								trait = fair
								has_character_modifier = follower_of_lempo
								has_character_modifier = follower_of_jarilo
							}
						}
						save_event_target_as = pagan_lover
					}
					event_target:pagan_lover = { character_event = { id = TOG.7509 } }
				}
				#Family deities
				if = {
					limit = {
						OR = {
							is_female = no
							AND = {
								is_female = yes
								NOT = { age = 46 }
							}
						}
						NOR = {
							trait = celibate
							trait = eunuch
						}
						OR = {
							has_character_modifier = follower_of_zemyna
							has_character_modifier = follower_of_yemoja
							has_character_modifier = follower_of_akka
						}
					}
					random_spouse = {
						limit = {
							OR = {
								is_female = no
								AND = {
									is_female = yes
									NOT = { age = 46 }
								}
							}
							NOR = {
								trait = celibate
								trait = eunuch
							}
						}
					 	character_event = { id = TOG.7511 } 
					}
				}
				#Death dieties
				if = {
					limit = {
						OR = {
							has_character_modifier = follower_of_morana
							has_character_modifier = follower_of_veles
							has_character_modifier = follower_of_velnias
						}
					}
					any_courtier = {
						limit = { 
							age = 4
							is_adult = no 
							NOT = { has_character_flag = asked_about_death }
						}
						save_event_target_as = death_child
					}
					any_ward = {
						limit = { NOT = { has_character_flag = asked_about_death } }
						save_event_target_as = death_child
					}
					any_child = {
						limit = { 
							age = 4
							is_adult = no 
							NOT = { has_character_flag = asked_about_death }
						}
						save_event_target_as = death_child
					}
					current_heir = {
						if = {
							limit = { 
								age = 4
								is_adult = no 
								NOT = { has_character_flag = asked_about_death }
							}
							save_event_target_as = death_child
						}
					}
					event_target:death_child = { character_event = { id = TOG.7513 } }
				}
				#Hunting dieties
				if = {
					limit = { has_character_modifier = follower_of_taipo_and_mielikki }
					character_event = { id = TOG.7517 }
				} 
			}
			#Theme events set 2
			20 = {
				#Martial gods
				if = {
					limit = {
						OR = {
							has_character_modifier = follower_of_perkunas
							has_character_modifier = follower_of_taipo_and_mielikki
							has_character_modifier = follower_of_shango
							has_character_modifier = follower_of_perun
						}
					}
					character_event = { id = TOG.7516 }
				}
				#Diplomacy gods
				if = {
					limit = {
						OR = {
							has_character_modifier = follower_of_dievas
							has_character_modifier = follower_of_akka
							has_character_modifier = follower_of_yemoja
						}
					}
					character_event = { id = TOG.7518 }
				}
				#Stewardship gods
				if = {
					limit = {
						OR = {
							has_character_modifier = follower_of_zemyna
							has_character_modifier = follower_of_ukko
							has_character_modifier = follower_of_ekwensu
							has_character_modifier = follower_of_jarilo
						}
					}
					character_event = { id = TOG.7520 }
				}
				#Intrigue gods
				if = {
					limit = {
						OR = {
							has_character_modifier = follower_of_velnias
							has_character_modifier = follower_of_lempo
							has_character_modifier = follower_of_veles
						}
					}
					character_event = { id = TOG.7522 }
				}
				#Learning gods
				if = {
					limit = {
						OR = {
							has_character_modifier = follower_of_orunmila
							has_character_modifier = follower_of_morana
						}
					}
					character_event = { id = TOG.7524 }
				}
			}
			#Monument event, only happens once per character
			50 = {
				modifier = {
					factor = 0
					has_character_flag = pagan_monument 
				}
				random_courtier = {
					limit = { has_job_title = job_treasurer }
					character_event = { id = TOG.7525  }
				}
			}
			30 = {
				#NOTHING
			}
		}
		character_event = { id = TOG.7100 days = 1000 random = 400 }
	}
}

#Remove main deity in case of religious conversion
character_event = {
	id = TOG.7101

	is_triggered_only = yes
	hide_window = yes

	trigger = {
		has_minor_deity_trigger = yes
		NOR = { #Checks that the character isn't reforming
			AND = {
				religion = slavic_pagan_reformed
				FROM = { religion = slavic_pagan }
			}
			AND = {
				religion = west_african_pagan_reformed
				FROM = { religion = west_african_pagan }
			}
			AND = {
				religion = finnish_pagan_reformed
				FROM = { religion = finnish_pagan }
			}
			AND = {
				religion = baltic_pagan_reformed
				FROM = { religion = baltic_pagan }
			}
		}
	}

	immediate = {
		remove_character_modifier = follower_of_perun
		remove_character_modifier = follower_of_veles
		remove_character_modifier = follower_of_jarilo
		remove_character_modifier = follower_of_morana
		remove_character_modifier = follower_of_yemoja
		remove_character_modifier = follower_of_ekwensu
		remove_character_modifier = follower_of_orunmila
		remove_character_modifier = follower_of_shango
		remove_character_modifier = follower_of_ukko
		remove_character_modifier = follower_of_akka
		remove_character_modifier = follower_of_taipo_and_mielikki 
		remove_character_modifier = follower_of_lempo
		remove_character_modifier = follower_of_dievas
		remove_character_modifier = follower_of_velnias
		remove_character_modifier = follower_of_perkunas
		remove_character_modifier = follower_of_zemyna
		remove_character_modifier = voice_of_dievas
		remove_character_modifier = voice_of_akka
		remove_character_modifier = voice_of_yemoja
		remove_character_modifier = zemynas_blessing
		remove_character_modifier = yemojas_blessing
		remove_character_modifier = akkas_blessing
	}
}

#Selecting deity, Slavic
character_event = {
	id = TOG.7110
	desc = EVTDESC_TOG_7110
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_tribal_shrine

	is_triggered_only = yes

	immediate = { 
		if = {
			limit = { is_playable = yes }
			any_courtier = {
				limit = {
					prisoner = no
					religion = ROOT
					age = 16
					has_minor_deity_trigger = no
					NOT = { is_playable = yes }
				}
				character_event = { id = TOG.7110 days = 1 }
			}
		}
	}

	option = {
		name = EVTOPTA_TOG_7110

		add_character_modifier = {
			name = follower_of_perun
			duration = -1
		}

		hidden_tooltip = { character_event = { id = TOG.7111 } }

		ai_chance = {
			factor = 1
			modifier = {
				has_education_martial_trigger = yes
				factor = 2
			}
			modifier = {
				trait = brave
				factor = 2
			}
		}
	}
	option = {
		name = EVTOPTB_TOG_7110

		add_character_modifier = {
			name = follower_of_veles
			duration = -1
		}

		hidden_tooltip = { character_event = { id = TOG.7112 } }

		ai_chance = {
			factor = 1
			modifier = {
				has_education_intrigue_trigger = yes
				factor = 2
			}
			modifier = {
				trait = deceitful
				factor = 2
			}
		}
	}
	option = {
		name = EVTOPTC_TOG_7110

		add_character_modifier = {
			name = follower_of_jarilo
			duration = -1
		}

		hidden_tooltip = { character_event = { id = TOG.7113 } }

		ai_chance = {
			factor = 1
			modifier = {
				has_education_stewardship_trigger = yes
				factor = 2
			}
			modifier = {
				is_fertile_trigger = yes
				factor = 2
			}
		}
	}
	option = {
		name = EVTOPTD_TOG_7110

		add_character_modifier = {
			name = follower_of_morana
			duration = -1
		}

		hidden_tooltip = { character_event = { id = TOG.7114 } }

		ai_chance = {
			factor = 1
			modifier = {
				has_education_learning_trigger = yes
				factor = 2
			}
			modifier = {
				is_learned_trigger = yes
				factor = 2
			}
		}
	}
}

#You picked Perun
character_event = {
	id = TOG.7111
	desc = EVTDESC_TOG_7111
	border = GFX_event_normal_frame_war
	picture = GFX_evt_viking_battle_oldgods

	is_triggered_only = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7111
	}
}

#You picked Veles
character_event = {
	id = TOG.7112
	desc = EVTDESC_TOG_7112
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_midwinter_blot_oldgods

	is_triggered_only = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7111
	}
}

#You picked Jarilo
character_event = {
	id = TOG.7113
	desc = EVTDESC_TOG_7113
	border = GFX_event_normal_frame_economy
	picture = GFX_evt_tribal_lands

	is_triggered_only = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7111
	}
}

#You picked Morana
character_event = {
	id = TOG.7114
	desc = EVTDESC_TOG_7114
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_midwinter_blot_oldgods

	is_triggered_only = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7111
	}
}

#Selecting deity, West African
character_event = {
	id = TOG.7200
	desc = EVTDESC_TOG_7200
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_desert

	is_triggered_only = yes

	immediate = { 
		if = {
			limit = { is_playable = yes }
			any_courtier = {
				limit = {
					prisoner = no
					religion = ROOT
					age = 16
					has_minor_deity_trigger = no
				}
				character_event = { id = TOG.7200 days = 1 }
			}
		}
	}

	option = {
		name = EVTOPTA_TOG_7200

		add_character_modifier = {
			name = follower_of_yemoja
			duration = -1
		}

		hidden_tooltip = { character_event = { id = TOG.7201 } }

		ai_chance = {
			factor = 1
			modifier = {
				has_education_diplomacy_trigger = yes
				factor = 2
			}
			modifier = {
				is_infertile_trigger = yes
				factor = 2
			}
			modifier = {
				is_benevolent_trigger = yes
				factor = 2
			}
		}
	}
	option = {
		name = EVTOPTB_TOG_7200

		add_character_modifier = {
			name = follower_of_ekwensu
			duration = -1
		}

		hidden_tooltip = { character_event = { id = TOG.7202 } }

		ai_chance = {
			factor = 1
			modifier = {
				has_education_stewardship_trigger = yes
				factor = 2
			}
			modifier = {
				trait = greedy
				factor = 2
			}
		}
	}
	option = {
		name = EVTOPTC_TOG_7200

		add_character_modifier = {
			name = follower_of_orunmila
			duration = -1
		}

		hidden_tooltip = { character_event = { id = TOG.7203 } }

		ai_chance = {
			factor = 1
			modifier = {
				has_education_learning_trigger = yes
				factor = 2
			}
			modifier = {
				is_learned_trigger = yes
				factor = 2
			}
		}
	}
	option = {
		name = EVTOPTD_TOG_7200

		add_character_modifier = {
			name = follower_of_shango
			duration = -1
		}

		hidden_tooltip = { character_event = { id = TOG.7204 } }

		ai_chance = {
			factor = 1
			modifier = {
				has_education_martial_trigger = yes
				factor = 2
			}
			modifier = {
				trait = brave
				factor = 2
			}
		}
	}
}

#You picked Yemoja
character_event = {
	id = TOG.7201
	desc = EVTDESC_TOG_7201
	border = GFX_event_normal_frame_diplomacy
	picture = GFX_evt_kraken

	is_triggered_only = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7111
	}
}

#You picked Ekwensu
character_event = {
	id = TOG.7202
	border = GFX_event_normal_frame_economy
	picture = GFX_evt_merchant_caravan

	desc = {
		trigger = { has_dlc = "Way of Life" }
		text = EVTDESC_TOG_7202
		picture = GFX_evt_merchant_caravan
	}
	desc = {
		trigger = { NOT = { has_dlc = "Way of Life" } }
		text = EVTDESC_TOG_7202
		picture = GFX_evt_carriage
	}

	is_triggered_only = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7111
	}
}

#You picked Orunmila
character_event = {
	id = TOG.7203
	desc = EVTDESC_TOG_7203
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_tribal_shrine

	is_triggered_only = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7111
	}
}

#You picked Shango
character_event = {
	id = TOG.7204
	desc = EVTDESC_TOG_7204
	border = GFX_event_normal_frame_war
	picture = GFX_evt_battle

	is_triggered_only = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7111
	}
}

#Selecting deity, Finnish Pagan
character_event = {
	id = TOG.7300
	desc = EVTDESC_TOG_7300
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_tribal_shrine

	is_triggered_only = yes

	immediate = { 
		if = {
			limit = { is_playable = yes }
			any_courtier = {
				limit = {
					prisoner = no
					religion = ROOT
					age = 16
					has_minor_deity_trigger = no
				}
				character_event = { id = TOG.7300 days = 1}
			}
		}
	}

	option = {
		name = EVTOPTA_TOG_7300

		add_character_modifier = {
			name = follower_of_ukko
			duration = -1
		}

		hidden_tooltip = { character_event = { id = TOG.7301 } }

		ai_chance = {
			factor = 1
			modifier = {
				has_education_stewardship_trigger = yes
				factor = 2
			}
		}
	}
	option = {
		name = EVTOPTB_TOG_7300

		add_character_modifier = {
			name = follower_of_akka
			duration = -1
		}

		hidden_tooltip = { character_event = { id = TOG.7302 } }

		ai_chance = {
			factor = 1
			modifier = {
				has_education_stewardship_trigger = yes
				factor = 2
			}
			modifier = {
				is_infertile_trigger = yes
				factor = 2
			}
			modifier = {
				is_benevolent_trigger = yes
				factor = 2
			}
		}
	}
	option = {
		name = EVTOPTC_TOG_7300

		add_character_modifier = {
			name = follower_of_taipo_and_mielikki
			duration = -1
		}

		hidden_tooltip = { character_event = { id = TOG.7303 } }

		ai_chance = {
			factor = 1
			modifier = {
				has_education_martial_trigger = yes
				factor = 2
			}
			modifier = {
				trait = hunter
				factor = 2
			}
		}
	}
	option = {
		name = EVTOPTD_TOG_7300

		add_character_modifier = {
			name = follower_of_lempo
			duration = -1
		}

		hidden_tooltip = { character_event = { id = TOG.7304 } }

		ai_chance = {
			factor = 1
			modifier = {
				has_education_intrigue_trigger = yes
				factor = 2
			}
			modifier = {
				trait = lustful
				factor = 2
			}
			modifier = {
				trait = seducer
				factor = 2
			}
			modifier = {
				trait = seductress
				factor = 2
			}
		}
	}
}

#You picked Ukko
character_event = {
	id = TOG.7301
	desc = EVTDESC_TOG_7301
	border = GFX_event_normal_frame_economy
	picture = GFX_evt_tribal_lands

	is_triggered_only = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7111
	}
}

#You picked Akka
character_event = {
	id = TOG.7302
	border = GFX_event_normal_frame_diplomacy
	desc = EVTDESC_TOG_7302
	picture = GFX_evt_birth

	is_triggered_only = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7111
	}
}

#You picked Taipo & Mielikki
character_event = {
	id = TOG.7303
	border = GFX_event_normal_frame_war
	picture = GFX_evt_longbowman_arabic

	desc = {
		trigger = { has_dlc = "Way of Life" }
		text = EVTDESC_TOG_7303
		picture = GFX_evt_mysterious_forest
	}
	desc = {
		trigger = { NOT = { has_dlc = "Way of Life" } }
		text = EVTDESC_TOG_7303
		picture = GFX_evt_longbowman_arabic
	}

	is_triggered_only = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7111
	}
}

#You picked Lempo
character_event = {
	id = TOG.7304
	desc = EVTDESC_TOG_7304
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_lovers

	is_triggered_only = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7111
	}
}

#Selecting deity, Baltic pagans
character_event = {
	id = TOG.7400
	desc = EVTDESC_TOG_7400
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_tribal_shrine

	is_triggered_only = yes

	immediate = { 
		#Assigns a god to all adults of the same religion at court
		if = {
			limit = { is_playable = yes }
			any_courtier = {
				limit = {
					prisoner = no
					religion = ROOT
					age = 16
					has_minor_deity_trigger = no
				}
				character_event = { id = TOG.7400 days = 1 }
			}
		}
	}

	option = {
		name = EVTOPTA_TOG_7400

		add_character_modifier = {
			name = follower_of_dievas
			duration = -1
		}

		hidden_tooltip = { character_event = { id = TOG.7401 } }

		ai_chance = {
			factor = 1
			modifier = {
				has_education_diplomacy_trigger = yes
				factor = 2
			}
		}
	}
	option = {
		name = EVTOPTB_TOG_7400

		add_character_modifier = {
			name = follower_of_velnias
			duration = -1
		}

		hidden_tooltip = { character_event = { id = TOG.7402 } }

		ai_chance = {
			factor = 1
			modifier = {
				has_education_intrigue_trigger = yes
				factor = 2
			}
		}
	}
	option = {
		name = EVTOPTC_TOG_7400

		add_character_modifier = {
			name = follower_of_perkunas
			duration = -1
		}

		hidden_tooltip = { character_event = { id = TOG.7403 } }

		ai_chance = {
			factor = 1
			modifier = {
				has_education_martial_trigger = yes
				factor = 2
			}
		}
	}
	option = {
		name = EVTOPTD_TOG_7400

		add_character_modifier = {
			name = follower_of_zemyna
			duration = -1
		}

		hidden_tooltip = { character_event = { id = TOG.7404 } }

		ai_chance = {
			factor = 1
			modifier = {
				has_education_stewardship_trigger = yes
				factor = 2
			}
		}
	}
}

#You picked Dievas
character_event = {
	id = TOG.7401
	desc = EVTDESC_TOG_7401
	border = GFX_event_normal_frame_diplomacy
	picture = GFX_evt_viking_throneroom_oldgods

	is_triggered_only = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7111
	}
}

#You picked Velnias
character_event = {
	id = TOG.7402
	border = GFX_event_normal_frame_intrigue
	desc = EVTDESC_TOG_7402
	picture = GFX_evt_death

	is_triggered_only = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7111
	}
}

#You picked Perkunas
character_event = {
	id = TOG.7403
	desc = EVTDESC_TOG_7403
	border = GFX_event_normal_frame_war
	picture = GFX_evt_viking_battle_oldgods

	is_triggered_only = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7111
	}
}

#You picked Zemyna
character_event = {
	id = TOG.7404
	desc = EVTDESC_TOG_7404
	border = GFX_event_normal_frame_economy
	picture = GFX_evt_tribal_lands

	is_triggered_only = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7111
	}
}

#Events which trigger depending on your main deity

#+1 Diplomacy
character_event = {
	id = TOG.7500
	border = GFX_event_normal_frame_diplomacy
	picture = GFX_evt_tribal_lands

	desc = {
		trigger = { has_character_modifier = follower_of_dievas }
		text = EVTDESC_TOG_7500_DIEVAS
		picture = GFX_evt_viking_throneroom_oldgods
	}
	desc = {
		trigger = { has_character_modifier = follower_of_akka }
		text = EVTDESC_TOG_7500_AKKA
		picture = GFX_evt_family
	}
	desc = {
		trigger = { has_character_modifier = follower_of_yemoja }
		text = EVTDESC_TOG_7500_YEMOJA
		picture = GFX_evt_family
	}

	is_triggered_only = yes
	hide_from = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7500

		change_diplomacy = 1
	}
}

#+1 Martial
character_event = {
	id = TOG.7501
	border = GFX_event_normal_frame_war
	picture = GFX_evt_battle

	desc = {
		trigger = { has_character_modifier = follower_of_perkunas }
		text = EVTDESC_TOG_7501_PERKUNAS
		picture = GFX_evt_viking_battle_oldgods
	}
	desc = {
		trigger = { has_character_modifier = follower_of_taipo_and_mielikki }
		text = EVTDESC_TOG_7501_TM
		picture = GFX_evt_hunt
	}
	desc = {
		trigger = { has_character_modifier = follower_of_shango }
		text = EVTDESC_TOG_7501_SHANGO
		picture = GFX_evt_battle
	}
	desc = {
		trigger = { has_character_modifier = follower_of_perun }
		text = EVTDESC_TOG_7501_PERUN
		picture = GFX_evt_viking_battle_oldgods
	}

	is_triggered_only = yes
	hide_from = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7500

		change_martial = 1
	}
}

#+1 Stewardship
character_event = {
	id = TOG.7502
	border = GFX_event_normal_frame_economy
	picture = GFX_evt_battle

	desc = {
		trigger = { has_character_modifier = follower_of_zemyna }
		text = EVTDESC_TOG_7502_ZEMYNA
		picture = GFX_evt_tribal_lands
	}
	desc = {
		trigger = { has_character_modifier = follower_of_ukko }
		text = EVTDESC_TOG_7502_UKKO
		picture = GFX_evt_tribal_lands
	}
	desc = {
		trigger = { has_character_modifier = follower_of_ekwensu }
		text = EVTDESC_TOG_7502_EKWENSU
		picture = GFX_evt_carriage
	}
	desc = {
		trigger = { has_character_modifier = follower_of_jarilo }
		text = EVTDESC_TOG_7502_JARILO
		picture = GFX_evt_tribal_lands
	}

	is_triggered_only = yes
	hide_from = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7500

		change_stewardship = 1
	}
}

#+1 Intrigue
character_event = {
	id = TOG.7503
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_whispers

	desc = {
		trigger = { has_character_modifier = follower_of_velnias }
		text = EVTDESC_TOG_7503_VELNIAS
	}
	desc = {
		trigger = { has_character_modifier = follower_of_lempo }
		text = EVTDESC_TOG_7503_LEMPO
	}
	desc = {
		trigger = { has_character_modifier = follower_of_veles }
		text = EVTDESC_TOG_7503_VELES
	}

	is_triggered_only = yes
	hide_from = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7500

		change_intrigue = 1
	}
}

#+1 Learning
character_event = {
	id = TOG.7504
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_tribal_shrine

	desc = {
		trigger = { has_character_modifier = follower_of_orunmila }
		text = EVTDESC_TOG_7503_ORUNMILA
	}
	desc = {
		trigger = { has_character_modifier = follower_of_morana }
		text = EVTDESC_TOG_7503_MORANA
	}

	is_triggered_only = yes
	hide_from = yes

	#OK
	option = {
		name = EVTOPTA_TOG_7500

		change_learning = 1
	}
}

#Friendship over same diety
character_event = {
	id = TOG.7505

	hide_window = yes

	is_triggered_only = yes

	option = {
		FROM = { character_event = { id = TOG.7506 } }
	}
}

character_event = {
	id = TOG.7506
	border = GFX_event_normal_frame_diplomacy
	picture = GFX_evt_tribal_shrine

	desc = {
		trigger = { has_character_modifier = follower_of_orunmila }
		text = EVTDESC_TOG_7506_ORUNMILA
		picture = GFX_evt_tribal_shrine
	}
	desc = {
		trigger = { has_character_modifier = follower_of_morana }
		text = EVTDESC_TOG_7506_MORANA
		picture = GFX_evt_tribal_shrine
	}
	desc = {
		trigger = { has_character_modifier = follower_of_perun }
		text = EVTDESC_TOG_7506_PERUN
		picture = GFX_evt_hunt
	}
	desc = {
		trigger = { has_character_modifier = follower_of_perkunas }
		text = EVTDESC_TOG_7506_PERKUNAS
		picture = GFX_evt_hunt
	}
	desc = {
		trigger = { has_character_modifier = follower_of_taipo_and_mielikki }
		text = EVTDESC_TOG_7506_TM
		picture = GFX_evt_hunt
	}
	desc = {
		trigger = { has_character_modifier = follower_of_shango }
		text = EVTDESC_TOG_7506_SHANGO
		picture = GFX_evt_longbowman_arabic
	}
	desc = {
		trigger = { has_character_modifier = follower_of_ukko }
		text = EVTDESC_TOG_7506_UKKO
		picture = GFX_evt_tribal_lands
	}
	desc = {
		trigger = { has_character_modifier = follower_of_zemyna }
		text = EVTDESC_TOG_7506_ZEMYNA
		picture = GFX_evt_tribal_lands
	}
	desc = {
		trigger = { has_character_modifier = follower_of_jarilo }
		text = EVTDESC_TOG_7506_JARILO
		picture = GFX_evt_tribal_lands
	}
	desc = {
		trigger = { has_character_modifier = follower_of_ekwensu }
		text = EVTDESC_TOG_7506_EKWENSU
		picture = GFX_evt_carriage
	}
	desc = {
		trigger = { has_character_modifier = follower_of_yemoja }
		text = EVTDESC_TOG_7506_YEMOJA
		picture = GFX_evt_tribal_shrine
	}
	desc = {
		trigger = { has_character_modifier = follower_of_akka }
		text = EVTDESC_TOG_7506_AKKA
		picture = GFX_evt_tribal_shrine
	}
	desc = {
		trigger = { has_character_modifier = follower_of_dievas }
		text = EVTDESC_TOG_7506_DIEVAS
		picture = GFX_evt_tribal_shrine
	}
	desc = {
		trigger = { has_character_modifier = follower_of_veles }
		text = EVTDESC_TOG_7506_VELES
		picture = GFX_evt_spymaster
	}
	desc = {
		trigger = { has_character_modifier = follower_of_lempo }
		text = EVTDESC_TOG_7506_LEMPO
		picture = GFX_evt_spymaster
	}
	desc = {
		trigger = { has_character_modifier = follower_of_velnias }
		text = EVTDESC_TOG_7506_VELNIAS
		picture = GFX_evt_spymaster
	}

	is_triggered_only = yes

	#Let's be friends
	option = {
		name = EVTOPTA_TOG_7506
		custom_tooltip = { text = EVTOPTA_TOG_7506_TOOLTIP }

		add_friend = FROM
	}

	#Nope
	option = {
		name = EVTOPTB_TOG_7506

		piety = 50
	}
}


#Thunder
character_event = {
	id = TOG.7507

	hide_window = yes

	is_triggered_only = yes

	option = {
		set_character_flag = scared_of_thunder
		FROM = { character_event = { id = TOG.7508 } }
	}
}

character_event = {
	id = TOG.7508
	border = GFX_event_normal_frame_diplomacy
	picture = GFX_evt_comet

	
	desc = {
		trigger = { has_character_modifier = follower_of_perun }
		text = EVTDESC_TOG_7508_PERUN
	}
	desc = {
		trigger = { has_character_modifier = follower_of_perkunas }
		text = EVTDESC_TOG_7508_PERKUNAS
	}
	desc = {
		trigger = { has_character_modifier = follower_of_shango }
		text = EVTDESC_TOG_7508_SHANGO
	}
	desc = {
		trigger = { has_character_modifier = follower_of_ukko }
		text = EVTDESC_TOG_7508_UKKO
	}

	is_triggered_only = yes

	#Run out into the storm
	option = {
		name = EVTOPTA_TOG_7508
		custom_tooltip = { text = EVTOPTA_TOG_7508_TOOLTIP }

		piety = 50

		random_list = {
			60 = {}
			25 = {
				if = {
					limit = { NOT = { trait = brave } }
					add_trait_brave_effect = yes
				}
				if = {
					limit = { trait = brave }
					prestige = 100
				}

				FROM = {
					if = {
						limit = {
							has_dlc = "Zeus"
							NOT = { age = 16 }
						}
						add_trait = willful
					}
					if = {
						limit = {
							OR = {
							 	NOT = { has_dlc = "Zeus" }
							 	age = 16
							}
						}
						remove_trait_craven_effect = yes
						add_trait_brave_effect = yes
					}
				}
			}
			15 = {
				add_character_modifier = {
					name = struck_by_lightning
					duration = 120
				}
			}
		}
	}

	#Tell a story
	option = {
		name = EVTOPTB_TOG_7508
		custom_tooltip = { text = EVTOPTB_TOG_7508_TOOLTIP }

		reverse_opinion = {
			who = FROM
			modifier = comforted_opinion
			years = 5
		}
	}

	#Tough love
	option = {
		name = EVTOPTC_TOG_7508
		custom_tooltip = { text = EVTOPTC_TOG_7508_TOOLTIP }

		reverse_opinion = {
			who = FROM
			modifier = tough_love_opinion
			years = 5
		}

		random = {
			chance = 25
			add_trait_wroth_effect = yes
		}
		FROM = {

			random_list = {
				50 = {
					if = {
						limit = {
							has_dlc = "Zeus"
							NOT = { age = 16 }
						}
						add_trait = willful
					}
					if = {
						limit = {
							OR = {
							 	NOT = { has_dlc = "Zeus" }
							 	age = 16
							}
						}
						remove_trait_craven_effect = yes
						add_trait_brave_effect = yes
					}
				}
				50 = {
					if = {
						limit = {
							has_dlc = "Zeus"
							NOT = { age = 16 }
							NOT = { trait = timid }
						}
						add_trait = timid
					}
					if = {
						limit = {
							OR = {
							 	NOT = { has_dlc = "Zeus" }
							 	age = 16
							}
						}
						add_trait_craven_effect = yes
					}
				}
			}
		}
	}

	after = { clear_event_target = thunder_target }
}

#Lover
character_event = {
	id = TOG.7509

	hide_window = yes

	is_triggered_only = yes

	option = {
		FROM = { character_event = { id = TOG.7510 } }
	}
}

character_event = {
	id = TOG.7510
	border = GFX_event_normal_frame_diplomacy
	picture = GFX_evt_lovers

	
	desc = {
		trigger = { has_character_modifier = follower_of_lempo }
		text = EVTDESC_TOG_7510_LEMPO
	}
	desc = {
		trigger = { has_character_modifier = follower_of_jarilo }
		text = EVTDESC_TOG_7510_JARILO
	}

	is_triggered_only = yes

	#Make love
	option = {
		name = {
			trigger = { has_character_modifier = follower_of_lempo }
			text = EVTOPTA_TOG_7510_LEMPO
		}
		name = {
			trigger = { has_character_modifier = follower_of_jarilo }
			text = EVTOPTA_TOG_7510_JARILO
		}

		add_trait_lustful_effect = yes

		piety = 50

		hidden_tooltip = { unprotected_sex_effect = yes }
	}

	#Become lovers
	option = {
		trigger = { NOT = { is_lover = FROM } }
		name = EVTOPTB_TOG_7510

		add_lover = FROM

		hidden_tooltip = {
			unprotected_sex_effect = yes

			if = {
				limit = { trait = homosexual } 
				FROM = { add_trait = homosexual }
			}
		}
	}

	#Not that interested
	option = {
		name = EVTOPTC_TOG_7510
		custom_tooltip = { text = EVTOPTC_TOG_7510_TOOLTIP }
	}	

	after = { clear_event_target = pagan_lover }
}

#Family is doing well
character_event = {
	id = TOG.7511

	hide_window = yes

	is_triggered_only = yes

	option = {
		FROM = { character_event = { id = TOG.7512 } }
	}
}

character_event = {
	id = TOG.7512
	border = GFX_event_normal_frame_diplomacy
	picture = GFX_evt_family

	
	desc = {
		trigger = { has_character_modifier = follower_of_zemyna }
		text = EVTDESC_TOG_7510_ZEMYNA
	}
	desc = {
		trigger = { has_character_modifier = follower_of_yemoja }
		text = EVTDESC_TOG_7510_YEMOJA
	}
	desc = {
		trigger = { has_character_modifier = follower_of_akka }
		text = EVTDESC_TOG_7510_AKKA
	}

	is_triggered_only = yes

	trigger = {
		NOR = {
			has_character_modifier = zemynas_blessing
			has_character_modifier = yemojas_blessing
			has_character_modifier = akkas_blessing
		}
	}

	#Everything is going well
	option = {
		name = EVTOPTA_TOG_7512
		
		#Removes rivalry or become lover
		if = {
			limit = {
				NOR = {
					is_rival = FROM
					is_lover = FROM
				}
			}
			add_lover = FROM
		}
		if = {
			limit = { is_rival = FROM }
			remove_rival = FROM
		}

		#Fertility bonus
		if = {
			limit = { has_character_modifier = follower_of_zemyna }
			add_character_modifier = {
				name = zemynas_blessing
				years = 5
			}
		}
		if = {
			limit = { has_character_modifier = follower_of_yemoja }
			add_character_modifier = {
				name = yemojas_blessing
				years = 5
			}
		}
		if = {
			limit = { has_character_modifier = follower_of_akka }
			add_character_modifier = {
				name = akkas_blessing
				years = 5
			}
		}

		#Children become happy
		any_child = {
			limit = { 
				liege = { character = ROOT }
				is_child_of = FROM
			}
			opinion = {
				who = ROOT
				modifier = happy_parent_opinion
				years = 5
			}
			hidden_tooltip = {
				opinion = {
					who = FROM
					modifier = happy_parent_opinion
					years = 5
				}
			}
		}

		hidden_tooltip = { unprotected_sex_effect = yes }
	}

	#Not that interested
	option = {
		name = EVTOPTB_TOG_7512

		random = {
			chance = 50
			add_trait_chaste_effect = yes
		}
	}	
}

#Child is scared of death
character_event = {
	id = TOG.7513

	hide_window = yes

	is_triggered_only = yes

	option = {
		set_character_flag = asked_about_death

		if = {
			limit = {
				NOR = {
					has_character_flag = inspiring_tale
					has_character_flag = dull_tale
					has_character_flag = hardening_tale
					has_character_flag = scary_tale
				}
			}
			FROM = { character_event = { id = TOG.7514 } }
		}
		if = {
			limit = {
				OR = {
					has_character_flag = inspiring_tale
					has_character_flag = dull_tale
					has_character_flag = hardening_tale
					has_character_flag = scary_tale
				}
			}
			FROM = { character_event = { id = TOG.7515 } }
		}
	}
}

character_event = {
	id = TOG.7514
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_child_play
	desc = EVTDESC_TOG_7514

	is_triggered_only = yes

	#Tell happy tale of death
	option = {
		name = {
			trigger = { has_character_modifier = follower_of_morana }
			text = EVTOPTA_TOG_7514_MORANA
		} 
		name = {
			trigger = { has_character_modifier = follower_of_veles }
			text = EVTOPTA_TOG_7514_VELES
		} 
		name = {
			trigger = { has_character_modifier = follower_of_velnias }
			text = EVTOPTA_TOG_7514_VELNIAS
		} 
		custom_tooltip = { text = EVTOPTA_TOG_7514_TOOLTIP }

		random = {
			chance = 25
			add_trait_kind_effect = yes
		}
		random = {
			chance = 50
			remove_trait_cruel_effect = yes
		}

		FROM = {
			random_list = {
				60 = {
					tooltip = {
						if = {
							limit = { 
								has_dlc = "Zeus"
								NOT = { trait = idolizer } 
							}
							add_trait = idolizer
						}
						if = {
							limit = { 
								NOT = { has_dlc = "Zeus" }
								NOT = { trait = erudite } 
							}
							add_trait = erudite
						}
						change_learning = 1
					}
					set_character_flag = inspiring_tale
				}
				40 = {
					tooltip = {
						if = {
							limit = { 
								has_dlc = "Zeus"
								NOT = { trait = indolent } 
							}
							add_trait = indolent
						}
						if = {
							limit = { 
								NOT = { has_dlc = "Zeus" }
								NOT = { trait = slothful } 
								NOT = { trait = diligent } 
							}
							add_trait = slothful
						}
						change_learning = -1
					}
					set_character_flag = dull_tale
				}
			}
		}

		hidden_tooltip = { FROM = { character_event = { id = TOG.7513 days = 3 } } }
	}

	#Tell them a sad tale of death
	option = {
		name = {
			trigger = { has_character_modifier = follower_of_morana }
			text = EVTOPTB_TOG_7514_MORANA
		} 
		name = {
			trigger = { has_character_modifier = follower_of_veles }
			text = EVTOPTB_TOG_7514_VELES
		} 
		name = {
			trigger = { has_character_modifier = follower_of_velnias }
			text = EVTOPTB_TOG_7514_VELNIAS
		} 
		custom_tooltip = { text = EVTOPTB_TOG_7514_TOOLTIP }

		random = {
			chance = 25
			add_trait_cruel_effect = yes
		}
		random = {
			chance = 50
			remove_trait_kind_effect = yes
		}

		FROM = {
			random_list = {
				60 = {
					tooltip = {
						if = {
							limit = { 
								has_dlc = "Zeus"
								NOT = { trait = willful } 
							}
							add_trait = willful
						}
						if = {
							limit = { 
								NOT = { has_dlc = "Zeus" }
								NOT = { trait = brave }
								NOT = { trait = craven } 
							}
							add_trait = brave
						}
						change_intrigue = 1
					}
					set_character_flag = hardening_tale
				}
				40 = {
					tooltip = {
						if = {
							limit = { 
								has_dlc = "Zeus"
								NOT = { trait = timid } 
								NOT = { trait = rowdy } 
							}
							add_trait = timid
						}
						if = {
							limit = { 
								NOT = { has_dlc = "Zeus" }
								NOT = { trait = brave }
								NOT = { trait = craven } 
							}
							add_trait = craven
						}
						change_intrigue = -1
					}
					set_character_flag = scary_tale
				}
			}
		}

		hidden_tooltip = { FROM = { character_event = { id = TOG.7513 days = 3 } } }
	}

	#No time
	option = {
		name = EVTOPTC_TOG_7514

	}
}

character_event = {
	id = TOG.7515
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_child_reading

	desc = {
		trigger = { FROM = { has_character_flag = inspiring_tale } }
		text = EVTDESC_TOG_7515_A
		picture = GFX_evt_child_reading
	}
	desc = {
		trigger = { FROM = { has_character_flag = dull_tale } }
		text = EVTDESC_TOG_7515_B
		picture = GFX_evt_child_play
	}
	desc = {
		trigger = { FROM = { has_character_flag = hardening_tale } }
		text = EVTDESC_TOG_7515_C
		picture = GFX_evt_child_reading
	}
	desc = {
		trigger = { FROM = { has_character_flag = scary_tale } }
		text = EVTDESC_TOG_7515_D
		picture = GFX_evt_child_bully
	}

	is_triggered_only = yes

	option = {
		trigger = { FROM = { has_character_flag = inspiring_tale } }
		name = {
			trigger = { has_character_modifier = follower_of_morana }
			text = EVTOPTA_TOG_7515_MORANA
		} 
		name = {
			trigger = { has_character_modifier = follower_of_veles }
			text = EVTOPTA_TOG_7515_VELES
		} 
		name = {
			trigger = { has_character_modifier = follower_of_velnias }
			text = EVTOPTA_TOG_7515_VELNIAS
		} 

		FROM = {
			clr_character_flag = inspiring_tale

			if = {
				limit = { 
					has_dlc = "Zeus"
					NOT = { trait = idolizer } 
				}
				add_trait = idolizer
			}
			if = {
				limit = { 
					NOT = { has_dlc = "Zeus" }
					NOT = { trait = erudite } 
				}
				add_trait = erudite
			}
			change_learning = 1
		}
	}

	option = {
		trigger = { FROM = { has_character_flag = dull_tale } }
		name = {
			trigger = { has_character_modifier = follower_of_morana }
			text = EVTOPTB_TOG_7515_MORANA
		} 
		name = {
			trigger = { has_character_modifier = follower_of_veles }
			text = EVTOPTB_TOG_7515_VELES
		} 
		name = {
			trigger = { has_character_modifier = follower_of_velnias }
			text = EVTOPTB_TOG_7515_VELNIAS
		} 

		FROM = {
			clr_character_flag = dull_tale

			if = {
				limit = { 
					has_dlc = "Zeus"
					NOT = { trait = indolent } 
				}
				add_trait = indolent
			}
			if = {
				limit = { 
					NOT = { has_dlc = "Zeus" }
					NOT = { trait = slothful } 
					NOT = { trait = diligent } 
				}
				add_trait = slothful
			}
			change_learning = -1
		}
	}

	option = {
		trigger = { FROM = { has_character_flag = hardening_tale } }
		name = {
			trigger = { has_character_modifier = follower_of_morana }
			text = EVTOPTA_TOG_7515_MORANA
		} 
		name = {
			trigger = { has_character_modifier = follower_of_veles }
			text = EVTOPTA_TOG_7515_VELES
		} 
		name = {
			trigger = { has_character_modifier = follower_of_velnias }
			text = EVTOPTA_TOG_7515_VELNIAS
		} 

		FROM = {
			clr_character_flag = hardening_tale
		
			if = {
				limit = { 
					has_dlc = "Zeus"
					NOT = { trait = willful } 
				}
				add_trait = willful
			}
			if = {
				limit = { 
					NOT = { has_dlc = "Zeus" }
					NOT = { trait = brave }
					NOT = { trait = craven } 
				}
				add_trait = brave
			}
			change_intrigue = 1
		}
	}

	option = {
		trigger = { FROM = { has_character_flag = scary_tale } }
		name = {
			trigger = { has_character_modifier = follower_of_morana }
			text = EVTOPTB_TOG_7515_MORANA
		} 
		name = {
			trigger = { has_character_modifier = follower_of_veles }
			text = EVTOPTB_TOG_7515_VELES
		} 
		name = {
			trigger = { has_character_modifier = follower_of_velnias }
			text = EVTOPTB_TOG_7515_VELNIAS
		} 

		FROM = {
			clr_character_flag = scary_tale

			if = {
				limit = { 
					has_dlc = "Zeus"
					NOT = { trait = timid } 
					NOT = { trait = rowdy } 
				}
				add_trait = timid
			}
			if = {
				limit = { 
					NOT = { has_dlc = "Zeus" }
					NOT = { trait = brave }
					NOT = { trait = craven } 
				}
				add_trait = craven
			}
			change_intrigue = -1
		}
	}

	after = { clear_event_target = death_child }
}

#16 Martial, increased levy
character_event = {
	id = TOG.7516
	border = GFX_event_normal_frame_war
	picture = GFX_evt_viking_battle_oldgods
	
	desc = {
		trigger = { has_character_modifier = follower_of_perkunas }
		text = EVTDESC_TOG_7516_PERKUNAS
	}
	desc = {
		trigger = { has_character_modifier = follower_of_taipo_and_mielikki }
		text = EVTDESC_TOG_5716_TM
	}
	desc = {
		trigger = { has_character_modifier = follower_of_shango }
		text = EVTDESC_TOG_7516_SHANGO
		picture = GFX_evt_battle
	}
	desc = {
		trigger = { has_character_modifier = follower_of_perun }
		text = EVTDESC_TOG_7516_PERUN
	}

	hide_from = yes

	is_triggered_only = yes

	option = {
		name = {
			trigger = { has_character_modifier = follower_of_taipo_and_mielikki }
			text = EVTOPTA_TOG_7516_A
		} 
		name = {
			trigger = { NOT = { has_character_modifier = follower_of_taipo_and_mielikki } }
			text = EVTOPTA_TOG_7516_B
		} 

		capital_scope = {
			add_province_modifier = {
				name = inspired_warriors
				years = 10
			}
		}
	}
}

#Healthy from hunting 
character_event = {
	id = TOG.7517
	border = GFX_event_normal_frame_war
	desc = EVTDESC_TOG_7517
	picture = GFX_evt_hunt

	trigger = { NOT = { has_character_modifier = hunters_physique } }

	is_triggered_only = yes

	option = {
		name = EVTOPTA_TOG_7517

		add_character_modifier = {
			name =  hunters_physique
			years = 10
		}
	}
}


#18 diplomacy, vassal boost
character_event = {
	id = TOG.7518
	border = GFX_event_normal_frame_diplomacy
	picture = GFX_evt_princess_byzantine

	
	desc = {
		trigger = { has_character_modifier = follower_of_dievas }
		text = EVTDESC_TOG_7518_DIEVAS
	}
	desc = {
		trigger = { has_character_modifier = follower_of_akka }
		text = EVTDESC_TOG_7518_AKKA
	}
	desc = {
		trigger = { has_character_modifier = follower_of_yemoja }
		text = EVTDESC_TOG_7518_YEMOJA
		picture = GFX_evt_emissary_arabic
	}

	hide_from = yes

	is_triggered_only = yes

	option = {
		name = {
			trigger = { has_character_modifier = follower_of_dievas }
			text = EVTOPTA_TOG_7518_A
		} 
		name = {
			trigger = { NOT = { has_character_modifier = follower_of_dievas } }
			text = EVTOPTA_TOG_7518_B
		} 

		if = {
			limit = { has_character_modifier = follower_of_dievas }
			add_character_modifier = {
				name = voice_of_dievas
				years = 10
			}
		}
		if = {
			limit = { has_character_modifier = follower_of_akka }
			add_character_modifier = {
				name = voice_of_akka
				years = 10
			}
		}
		if = {
			limit = { has_character_modifier = follower_of_yemoja }
			add_character_modifier = {
				name = voice_of_yemoja
				years = 10
			}
		}
	}
}


#20 stewardship, tax or prosperity
character_event = {
	id = TOG.7520
	border = GFX_event_normal_frame_economy
	picture = GFX_evt_tribal_lands
	
	desc = {
		trigger = { has_character_modifier = follower_of_zemyna }
		text = EVTDESC_TOG_7520_ZEMYNA
	}
	desc = {
		trigger = { has_character_modifier = follower_of_ukko }
		text = EVTDESC_TOG_7520_UKKO
	}
	desc = {
		trigger = { has_character_modifier = follower_of_jarilo }
		text = EVTDESC_TOG_7520_JARILO
	}
	desc = {
		trigger = { has_character_modifier = follower_of_ekwensu }
		text = EVTDESC_TOG_7520_EKWENSU
		picture = GFX_evt_market_byzantine
	}

	hide_from = yes

	is_triggered_only = yes

	trigger = { capital_scope = { NOT = { has_province_modifier = blessed_lands } } } 

	option = {
		name = EVTOPTA_TOG_7520

		#Changes depopulation/prosperity
		if = {
			limit = {
				has_dlc = "Reapers"
				capital_scope = { NOT = { has_province_modifier = prosperity_modifier_3 } }
			}
			if = {
				limit = { capital_scope = { has_province_modifier = depopulated_1 } }

				capital_scope = { remove_province_modifier = depopulated_1 }
				break = yes
			}	
			if = {
				limit = { capital_scope = { has_province_modifier = depopulated_2 } }

				capital_scope = { 
					remove_province_modifier = depopulated_2
					add_province_modifier = { name = depopulated_1 duration = -1 }
				}
				break = yes
			}
			if = {
				limit = { capital_scope = { has_province_modifier = depopulated_3 } }

				capital_scope = { 
					remove_province_modifier = depopulated_3
					add_province_modifier = { name = depopulated_2 duration = -1 }
				}
				break = yes
			}
			capital_scope = { increase_prosperity_effect = yes }
		}
		if = {
			limit = {
				OR = {
					NOT = { has_dlc = "Reapers" }
					capital_scope = { has_province_modifier = prosperity_modifier_3 }
				}
			}
			capital_scope = {
				add_province_modifier = { 
					name = blessed_lands 
					years = 10
				}
			}
		}
	}
}


#22 Intrigue, reveals plot
character_event = {
	id = TOG.7522
	border = GFX_event_normal_frame_intrigue
	picture = GFX_evt_shadowy_cabal

	hide_from = yes

	desc = {
		trigger = { 
			has_character_modifier = follower_of_lempo 
			event_target:god_plot_target = { character = ROOT }
		}
		text = EVTDESC_TOG_7522_LEMPO_ME
	}
	desc = {
		trigger = { 
			has_character_modifier = follower_of_velnias 
			event_target:god_plot_target = { character = ROOT }
		}
		text = EVTDESC_TOG_7522_VELNIAS_ME
	}
	desc = {
		trigger = { 
			has_character_modifier = follower_of_veles
			event_target:god_plot_target = { character = ROOT }
		}
		text = EVTDESC_TOG_7522_VELES_ME
	}
	desc = {
		trigger = { 
			has_character_modifier = follower_of_lempo 
			NOT = { event_target:god_plot_target = { character = ROOT } }
		}
		text = EVTDESC_TOG_7522_LEMPO
	}
	desc = {
		trigger = { 
			has_character_modifier = follower_of_velnias 
			NOT = { event_target:god_plot_target = { character = ROOT } }
		}
		text = EVTDESC_TOG_7522_VELNIAS
	}
	desc = {
		trigger = { 
			has_character_modifier = follower_of_veles
			NOT = { event_target:god_plot_target = { character = ROOT } }
		}
		text = EVTDESC_TOG_7522_VELES
	}
	
	trigger = {
		any_realm_character = {
			has_plot = yes
			NOT = { plot_is_known_by = ROOT }
		}
	}

	immediate = {
		random_realm_character = {
			limit = {
				has_plot = yes
				NOT = { plot_is_known_by = ROOT }
			}
			save_event_target_as = god_plotter
		}
		random_realm_character = {
			limit = {
				has_plot = yes
				NOT = { plot_is_known_by = ROOT }
				is_landed = yes
			}
			save_event_target_as = god_plotter
		}
		random_realm_character = {
			limit = {
				has_plot = yes
				NOT = { plot_is_known_by = ROOT }
				plot_target_char = { is_close_relative = ROOT }
			}
			save_event_target_as = god_plotter
		}
		random_realm_character = {
			limit = {
				has_plot = yes
				NOT = { plot_is_known_by = ROOT }
				plot_target_char = { character = ROOT }
			}
			save_event_target_as = god_plotter
		}
		
		event_target:god_plotter = { plot_target_char = { save_event_target_as = god_plot_target } }
	
	}

	is_triggered_only = yes

	option = {
		name = {
			trigger = { event_target:god_plot_target = { character = ROOT } }
			text = EVTOPTA_TOG_7522_A
		}
		name = {
			trigger = { opinion = { who = event_target:god_plot_target value = 20 } }
			text = EVTOPTA_TOG_7522_B
		}
		name = {
			trigger = { NOT = { opinion = { who = event_target:god_plot_target value = 20 } } }
			text = EVTOPTA_TOG_7522_C
		}
		event_target:god_plotter = { reveal_plot = yes}

	}
}

#24 Learning, tech bonus
character_event = {
	id = TOG.7524 
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_library

	desc = {
		trigger = { has_character_modifier = follower_of_orunmila }
		text = EVTDESC_TOG_7524_ORUNMILA
	}
	desc = {
		trigger = { has_character_modifier = follower_of_morana }
		text = EVTDESC_TOG_7524_MORANA
	}

	is_triggered_only = yes

	hide_from = yes

	option = {
		name = EVTOPTA_TOG_7524

		random_list = {
			33 = { military_techpoints = 100 }
			33 = { economy_techpoints = 100 }
			33 = { culture_techpoints = 100 }
		}
	}
}


#Monument in honor
character_event = {
	id = TOG.7525 
	
	hide_window = yes

	is_triggered_only = yes

	immediate = { FROM = { character_event =  { id = TOG.7526 } } }
}

character_event = {
	id = TOG.7526 
	border = GFX_event_normal_frame_economy
	picture = GFX_evt_irminsul_shrine

	desc = {
		trigger = { 
			OR = {
				religion = west_african_pagan
				religion = west_african_pagan_reformed
			}
		}
		text = EVTDESC_TOG_7526
		picture = GFX_evt_sun_temple
	}
	desc = {
		trigger = { 
			NOR = {
				religion = west_african_pagan
				religion = west_african_pagan_reformed
			}
		}
		text = EVTDESC_TOG_7526
		picture = GFX_evt_irminsul_shrine
	}


	is_triggered_only = yes

	option = {
		name = {
			trigger = { has_character_modifier = follower_of_orunmila }
			text = EVTOPTA_TOG_7526_ORUNMILA
		}
		name = {
			trigger = { has_character_modifier = follower_of_morana }
			text = EVTOPTA_TOG_7526_MORANA
		}
		name = {
			trigger = { has_character_modifier = follower_of_perun }
			text = EVTOPTA_TOG_7526_PERUN
		}
		name = {
			trigger = { has_character_modifier = follower_of_perkunas }
			text = EVTOPTA_TOG_7526_PERKUNAS
		}
		name = {
			trigger = { has_character_modifier = follower_of_taipo_and_mielikki }
			text = EVTOPTA_TOG_7526_TM
		}
		name = {
			trigger = { has_character_modifier = follower_of_shango }
			text = EVTOPTA_TOG_7526_SHANGO
		}
		name = {
			trigger = { has_character_modifier = follower_of_ukko }
			text = EVTOPTA_TOG_7526_UKKO
		}
		name = {
			trigger = { has_character_modifier = follower_of_zemyna }
			text = EVTOPTA_TOG_7526_ZEMYNA
		}
		name = {
			trigger = { has_character_modifier = follower_of_jarilo }
			text = EVTOPTA_TOG_7526_JARILO
		}
		name = {
			trigger = { has_character_modifier = follower_of_ekwensu }
			text = EVTOPTA_TOG_7526_EKWENSU
		}
		name = {
			trigger = { has_character_modifier = follower_of_yemoja }
			text = EVTOPTA_TOG_7526_YEMOJA
		}
		name = {
			trigger = { has_character_modifier = follower_of_akka }
			text = EVTOPTA_TOG_7526_AKKA
		}
		name = {
			trigger = { has_character_modifier = follower_of_dievas }
			text = EVTOPTA_TOG_7526_DIEVAS
		}
		name = {
			trigger = { has_character_modifier = follower_of_veles }
			text = EVTOPTA_TOG_7526_VELES
		}
		name = {
			trigger = { has_character_modifier = follower_of_lempo }
			text = EVTOPTA_TOG_7526_LEMPO
		}
		name = {
			trigger = { has_character_modifier = follower_of_velnias }
			text = EVTOPTA_TOG_7526_VELNIAS
		}

		custom_tooltip = { text = EVTOPTA_TOG_7525_TOOLTIP }

		scaled_wealth = { value = -0.25 min = -20 }

		hidden_tooltip = { capital_scope = { save_event_target_as = pagan_capital } } #I promise this is needed

		event_target:pagan_capital = {
			add_province_modifier = {
				name = building_monument
				years = 1
			}
		}

		hidden_tooltip = { 
			character_event = { id = TOG.7527 days = 365 } 
			set_character_flag = pagan_monument
			set_character_flag = monument_for_diety
		}
	}

	option = {
		name = EVTOPTB_TOG_7526
		custom_tooltip = { text = EVTOPTB_TOG_7525_TOOLTIP }

		scaled_wealth = { value = -0.25 min = -20 }

		hidden_tooltip = { capital_scope = { save_event_target_as = pagan_capital } } #I promise this is needed

		event_target:pagan_capital = {
			add_province_modifier = {
				name = building_monument
				years = 1
			}
		}

		hidden_tooltip = { 
			set_character_flag = monument_for_ancestors
			set_character_flag = pagan_monument
			character_event = { id = TOG.7527 days = 365 } 
		}
	}

	option = {
		name = EVTOPTC_TOG_7526
	}
}

character_event = {
	id = TOG.7527
	border = GFX_event_normal_frame_economy
	desc = EVTDESC_TOG_7527_ORUNMILA
	picture = GFX_evt_irminsul_shrine

	desc = {
		trigger = { 
			has_character_flag = monument_for_ancestors 
			NOR = {
				religion = west_african_pagan
				religion = west_african_pagan_reformed
			}
		}
		text = EVTDESC_TOG_7527_ANCESTORS
	}
	desc = {
		trigger = { 
			has_character_flag = monument_for_ancestors 
			OR = {
				religion = west_african_pagan
				religion = west_african_pagan_reformed
			}
		}
		text = EVTDESC_TOG_7527_ANCESTORS
		picture = GFX_evt_sun_temple
	}
	desc = {
		trigger = { 
			NOT = { has_character_flag = monument_for_ancestors }
			has_character_modifier = follower_of_orunmila 
		}
		text = EVTDESC_TOG_7527_ORUNMILA
		picture = GFX_evt_sun_temple
	}
	desc = {
		trigger = { 
			NOT = { has_character_flag = monument_for_ancestors }
			has_character_modifier = follower_of_morana 
		}
		text = EVTDESC_TOG_7527_MORANA
	}
	desc = {
		trigger = { 
			NOT = { has_character_flag = monument_for_ancestors }
			has_character_modifier = follower_of_perun 
		}
		text = EVTDESC_TOG_7527_PERUN
	}
	desc = {
		trigger = { 
			NOT = { has_character_flag = monument_for_ancestors }
			has_character_modifier = follower_of_perkunas 
		}
		text = EVTDESC_TOG_7527_PERKUNAS
	}
	desc = {
		trigger = { 
			NOT = { has_character_flag = monument_for_ancestors }
			has_character_modifier = follower_of_taipo_and_mielikki 
		}
		text = EVTDESC_TOG_7527_TM
	}
	desc = {
		trigger = { 
			NOT = { has_character_flag = monument_for_ancestors }
			has_character_modifier = follower_of_shango 
		}
		text = EVTDESC_TOG_7527_SHANGO
		picture = GFX_evt_sun_temple
	}
	desc = {
		trigger = { 
			NOT = { has_character_flag = monument_for_ancestors }
			has_character_modifier = follower_of_ukko 
		}
		text = EVTDESC_TOG_7527_UKKO
	}
	desc = {
		trigger = { 
			NOT = { has_character_flag = monument_for_ancestors }
			has_character_modifier = follower_of_zemyna 
		}
		text = EVTDESC_TOG_7527_ZEMYNA
	}
	desc = {
		trigger = { 
			NOT = { has_character_flag = monument_for_ancestors }
			has_character_modifier = follower_of_jarilo 
		}
		text = EVTDESC_TOG_7527_JARILO
	}
	desc = {
		trigger = { 
			NOT = { has_character_flag = monument_for_ancestors }
			has_character_modifier = follower_of_ekwensu 
		}
		text = EVTDESC_TOG_7527_EKWENSU
		picture = GFX_evt_sun_temple
	}
	desc = {
		trigger = { 
			NOT = { has_character_flag = monument_for_ancestors }
			has_character_modifier = follower_of_yemoja 
		}
		text = EVTDESC_TOG_7527_YEMOJA
		picture = GFX_evt_sun_temple
	}
	desc = {
		trigger = { 
			NOT = { has_character_flag = monument_for_ancestors }
			has_character_modifier = follower_of_akka 
		}
		text = EVTDESC_TOG_7527_AKKA
	}
	desc = {
		trigger = { 
			NOT = { has_character_flag = monument_for_ancestors }
			has_character_modifier = follower_of_dievas 
		}
		text = EVTDESC_TOG_7527_DIEVAS
	}
	desc = {
		trigger = { 
			NOT = { has_character_flag = monument_for_ancestors }
			has_character_modifier = follower_of_veles 
		}
		text = EVTDESC_TOG_7527_VELES
	}
	desc = {
		trigger = { 
			NOT = { has_character_flag = monument_for_ancestors }
			has_character_modifier = follower_of_lempo
		}
		text = EVTDESC_TOG_7527_LEMPO
	}
	desc = {
		trigger = { 
			NOT = { has_character_flag = monument_for_ancestors }
			has_character_modifier = follower_of_velnias 
		}
		text = EVTDESC_TOG_7527_VELNIAS
	}

	is_triggered_only = yes

	hide_from = yes

	option = {
		name = EVTOPTA_TOG_7527

		if = {
			limit = { has_character_flag = monument_for_diety }
			piety = 250
			clr_character_flag = monument_for_diety

			capital_scope = {
				remove_province_modifier = building_monument
				add_province_modifier = {
					name = holy_monument
					duration = -1
				} 
			}
		}
		if = {
			limit = { has_character_flag = monument_for_ancestors }
			prestige = 250
			clr_character_flag = monument_for_ancestors

			capital_scope = {
				remove_province_modifier = building_monument
				add_province_modifier = {
					name = ancestral_monument
					duration = -1
				} 
			}
		}

		save_event_target_as = monument_erector
		capital_scope = { province_event = { id = TOG.7528 days = 365 } }
	}
}

#Removing monument
province_event = {
	id = TOG.7528
	
	hide_window = yes
	is_triggered_only = yes

	trigger = {
		OR = {
			has_province_modifier = holy_monument
			has_province_modifier = ancestral_monument
		}
	}

	immediate = { 
		if = {
			limit = { NOT = { owner = { character = event_target:monument_erector } } }
			remove_province_modifier = holy_monument
			remove_province_modifier = ancestral_monument
		}
		province_event = { id = TOG.7528 days = 365 } 
	}
}