namespace = GKH
character_event = {
	id = GKH.0
	desc = EVTDESCGKH.0
	picture = GFX_evt_castle_construction

	trigger = {
		has_landed_title = c_old_wyk
		wealth = 1200
		154 = {
			NOR = {
				has_province_modifier = rebuilding_GKH
				has_province_modifier = completeGKH
			}
		}
		NOT = {
			b_naggas_hill = { has_building = ca_gkhall }
		}
	}

	mean_time_to_happen = {
		years = 5
	}

	option = {
		name = EVTOPTAGKH.0
		wealth = -600
		b_naggas_hill = { gain_title = ROOT }
		154 = { province_event =  { id =GKH.1 } }
	}
	
	option = { 
		name = EVTOPTBGKH.0
		prestige = -100
	}
}
province_event = {
	id = GKH.1
	desc = EVTDESCGKH.1
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	trigger = {
		154 = { 
			NOR = {
				has_province_modifier = rebuilding_GKH
				has_province_modifier = completeGKH
			}
		}
	}

	option = {
		name = EVTOPTAGKH.1
		add_province_modifier = { 
			name = rebuilding_GKH
			duration = -1
		}
		b_naggas_hill = { province_capital = yes }
	}
}
character_event = {
	id = GKH.5
	desc = EVTDESCGKH.5
	picture = GFX_evt_castle_construction

	trigger = {
		has_landed_title = c_old_wyk
		154 = {
			has_province_modifier = rebuilding_GKH
			NOT = { has_province_modifier = completeGKH }
		}
		b_naggas_hill = { NOT = { has_building = ca_naggas_hearth } }
	}

	mean_time_to_happen = {
		years = 1
	}

	option = {
		name = EVTOPTAGKH.5
		b_naggas_hill = { add_building = ca_naggas_hearth }
		wealth = -100
		prestige = 100
	}
}
character_event = {
	id = GKH.6
	desc = EVTDESCGKH.6
	picture = GFX_evt_castle_construction

	trigger = {
		has_landed_title = c_old_wyk
		154 = {
			has_province_modifier = rebuilding_GKH
			NOT = { has_province_modifier = completeGKH }
		}
		b_naggas_hill = { NOT = { has_building = ca_starfish_table } }
	}

	mean_time_to_happen = {
		years = 1
	}

	option = {
		name = EVTOPTAGKH.6
		b_naggas_hill = { add_building = ca_starfish_table }
		wealth = -100
		prestige = 100
	}
}
character_event = {
	id = GKH.2
	desc = EVTDESCGKH.2
	picture = GFX_evt_castle_construction

	trigger = {
		has_landed_title = c_old_wyk
		wealth = 300
		154 = {
			has_province_modifier = rebuilding_GKH
			NOT = { has_province_modifier = completeGKH }
		}
	}

	mean_time_to_happen = {
		years = 10
	}
	immediate = {
		b_naggas_hill = {
			if = {
				limit = { not = { has_building = ca_naggas_hearth } }
				ROOT = { character_event = { id = GKH.5 } }
			}
		}
		b_naggas_hill = {
			if = {
				limit = { not = { has_building = ca_starfish_table } }
				ROOT = { character_event = { id = GKH.6 } }
			}
		}
	}

	option = {
		name = EVTOPTAGKH.2
		154 = {
			remove_province_modifier = rebuilding_GKH
			add_province_modifier = {
				name = completeGKH
				duration = -1
			}
		}
		b_naggas_hill = { add_building = ca_gkhall }
		prestige = 500
		piety = 200
	}
}
character_event = {
	id = GKH.3
	desc = EVTDESCGKH.3
	picture = GFX_evt_castle_construction

	trigger = {
		has_landed_title = c_old_wyk
		NOT = { has_global_flag = GKHcomplete }
		OR = {
			culture = ironborn
			religion = drowned_god
		}
		NOT = { 
			primary_title = {
				OR = {
					title = k_iron_isles
					title = e_iron_isles
				}
			}
		}
		NOR = {
			has_claim = k_iron_isles
			has_claim = e_iron_isles
		}
		154 = {
			has_province_modifier = completeGKH
		}
	}

	mean_time_to_happen = {
		months = 6
	}

	option = {
		name = EVTOPTAGKH.3
		if = {
			limit = {
				e_iron_isles = { has_holder = yes }
				not = { has_claim = e_iron_isles }
			}
			add_claim = e_iron_isles
		}
		if = {
			limit = {
				e_iron_isles = { has_holder = no }
				not = { has_claim = k_iron_isles }
			}
			add_claim = k_iron_isles
		}
		c_old_wyk = { ROOT = { capital = prev } }
		set_global_flag = GKHcomplete
	}
}
character_event = {
	id = GKH.4
	desc = EVTDESCGKH.4
	picture = GFX_evt_castle_construction

	trigger = {
		has_landed_title = c_old_wyk
		NOT = { has_global_flag = GKHcomplete }
		OR = {
			culture = ironborn
			religion = drowned_god
		}
		primary_title = {
			OR = {
				title = k_iron_isles
				title = e_iron_isles
			}
		}
		154 = {
			is_capital = no
			has_province_modifier = completeGKH
		}
	}

	mean_time_to_happen = {
		months = 1
	}

	option = {
		name = EVTOPTAGKH.4
		c_old_wyk = { ROOT = { capital = prev } }
		set_global_flag = GKHcomplete
	}
}
character_event = {
	id = GKH.7
	desc = EVTDESCGKH.7
	picture = GFX_evt_reavingvillageraid

	capable_only = yes
	prisoner = no
	
	trigger = {
		trait = on_reaving
		has_character_flag = reaving_begins
		OR = {
			has_character_flag = reaving_village_raid
			has_character_flag = reaving_ship_attack
		}
		154 = {
			is_capital = yes
			has_province_modifier = completeGKH
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}


	option = {
		name = EVTOPTAGKH.7
		random_list = {
			35 = { prestige = 50 }
			40 = { wealth = 50 }
			25 = { piety = 50 }
		}
	}
	
}
character_event = {
	id = GKH.8
	desc = EVTDESCGKH.8
	picture = GFX_evt_reavingvillageraid
	
	trigger = {
		primary_title = {
			title = e_iron_isles
		}
		OR = {
			culture = ironborn
			religion = drowned_god
		}
		154 = {
			is_capital = yes
			has_province_modifier = completeGKH
		}
	}

	mean_time_to_happen = {
		years = 5
	}


	option = {
		name = EVTOPTAGKH.8
		capital_scope = {
			holder_scope = {
				spawn_unit = {
					province = PREV
					home = PREV
					owner = THIS
					match_character = THIS
					match_mult = 0.025
					match_min = 100
					match_max = 3000
					attrition = 1.0
					looter = yes
					cannot_inherit = yes
					earmark = tribal_organize_raid
				}
			}
		}
	}
	
}
character_event = {
	id = GKH.9
	desc = EVTDESCGKH.9
	picture = GFX_evt_castle_construction

	trigger = {
		NOT = { has_character_flag = GKHkingsmoot }
		primary_title = {
			is_republic = no
			is_theocracy = no
			OR = {
				title = k_iron_isles
				title = e_iron_isles
			}
		}
		OR = {
			culture = ironborn
			religion = drowned_god
		}
		154 = {
			is_capital = yes
			has_province_modifier = completeGKH
		}
	}

	mean_time_to_happen = {
		years = 5
	}

	option = {
		name = EVTOPTAGKH.9
		primary_title = {
			gender_succ = agnatic
			succession = feudal_elective
		}
		prestige = 50
		piety = 50
		set_character_flag = GKHkingsmoot
	}

	option = {
		name = EVTOPTBGKH.9
		prestige = 100
		set_character_flag = GKHkingsmoot
	}
}

character_event = {
	id = GKH.10
	desc = EVTDESCGKH.10
	picture = GFX_targaryen_balerion
	is_triggered_only = yes

	option = {
		name = EVTOPTAGKH.10
		create_character = {
			name = Nagga
			dynasty = culture
			age = 100
			culture = dragon
			religion = dragon_rel
			attributes = {
				martial = 50
			}
		}
		new_character = {
			add_trait = dragon
			add_trait = strong
			add_trait = fair
			add_trait = dragon_12
			character_event = { id = GKH.1099 }
		}
		set_global_flag = nagga_reborn
		if = {
			limit = {
				NOT = { has_global_flag = flag_return_of_magic } 
				NOT = { has_global_flag = age_of_dragons }
			}
			set_global_flag = flag_return_of_magic
		}		
	}
}

character_event = {
	id = GKH.1099
	is_triggered_only = yes
	hide_window = yes
	
	immediate = {
		ROOT = {
			if = {
				limit = { 
					NOT = { father_even_if_dead = { always = yes } }
					NOT = { mother_even_if_dead = { always = yes } }
				}
				create_character = {
					name = Nagga
					dynasty = none
					age = 230
					culture = dragon
					religion = dragon_rel
					female = yes
				}
				new_character = {
					add_trait = dragon
					ROOT = { set_mother = PREV }	
					death = yes
				}
			}
		}
	}
}

character_event = {
	id = GKH.11
	desc = EVTDESCGKH.11
	picture = GFX_evt_merchant_ship_at_sea_republic

	trigger = {
		primary_title = {
			is_republic = no
			is_theocracy = no
			OR = {
				title = k_iron_isles
				title = e_iron_isles
			}
		}
		NOT = { has_global_flag = nagga_reborn }
		154 = {
			is_capital = yes
			has_province_modifier = rebuilding_GKH
			NOT = { has_province_modifier = completeGKH }
		}
	}

	mean_time_to_happen = {
		years = 5
	}

	option = {
		name = EVTOPTAGKH.11
		hidden_tooltip = { character_event = { id = GKH.10 days = 21 } }
	}
}