﻿on_6th_birthday = {
	on_actions = {
		agotma_destined_dragonseed_effect
	}
}

agotma_destined_dragonseed_effect = {
	effect = {
		if = {
			limit = {
				has_game_rule = agotma_destined_dragonseed_enabled
				agot_dragon_population_extinct = yes
				NOT = { agot_has_dragonblood_heritage = yes }
				is_alive = yes
				is_human = yes
			}
			random_list = {
				24999 = {
					#normal birth
				}
				1 = {
					modifier = {
						real_father ?= {
							OR = {
								has_trait = red_priest
								has_trait = burned
								has_trait = albino
								has_trait = scaly
								has_trait = fire_obsessed
							}
						}
						factor = 3
					}
					modifier = {
						real_mother ?= {
							OR = {
								has_trait = red_priest
								has_trait = burned
								has_trait = albino
								has_trait = scaly
								has_trait = fire_obsessed
							}
						}
						factor = 3
					}
					modifier = {
						has_trait = fire_obsessed
						factor = 3
					}
					modifier = {
						has_trait = scaly
						factor = 3
					}
					modifier = {
						has_trait = albino
						factor = 3
					}
					modifier = {
						has_trait = burned
						factor = 3
					}
					modifier = {
						OR = {
							real_father ?= {
								exists = culture
								culture = { has_cultural_pillar = heritage_valyrian }
							}
							real_mother ?= {
								exists = culture
								culture = { has_cultural_pillar = heritage_valyrian }
							}
						}
						factor = 3
					}
					modifier = {
						OR = {
							real_father.real_father ?= {
								exists = culture
								culture = { has_cultural_pillar = heritage_valyrian }
							}
							real_mother.real_father ?= {
								exists = culture
								culture = { has_cultural_pillar = heritage_valyrian }
							}
							real_father.real_mother ?= {
								exists = culture
								culture = { has_cultural_pillar = heritage_valyrian }
							}
							real_mother.real_mother ?= {
								exists = culture
								culture = { has_cultural_pillar = heritage_valyrian }
							}
						}
						factor = 2
					}
					add_character_flag = dragonseed_potential_low
				}
			}
		}
	}
}