﻿namespace = agot_house_customizer


#Event that fires on game start to tell you the instructions
agot_house_customizer.0001 = {
	type = character_event
    title = agot_house_customizer.0001.t
    desc = agot_house_customizer.0001.desc

	theme = family

	override_background = {
		event_background = physicians_study
	}

	left_portrait = {
		character = root
		animation = throne_room_writer
	}

	right_portrait = {
		character = root
		animation = throne_room_writer
	}


	immediate = {
		play_music_cue = "mx_cue_succession"
	}
	
	#I want to select an extinct house to play as.
	option = {
		name = agot_house_customizer.0001.a
		trigger_event = {
			id = agot_house_customizer.0002
		}
	}

	#I want to select a living house to play as.
	option = {
		name = agot_house_customizer.0001.b
	}
}


#Region Select for Extinct Houses
agot_house_customizer.0002 = {
	type = character_event
    title = agot_house_customizer.0002.t
    desc = agot_house_customizer.0002.desc

	theme = family

	override_background = {
		event_background = physicians_study
	}

	left_portrait = {
		character = root
		animation = throne_room_writer
	}

	right_portrait = {
		character = root
		animation = throne_room_writer
	}

	immediate = {
		play_music_cue = "mx_cue_succession"
	}
	
	#Displays Extinct Northern Houses
	option = {
		name = agot_house_customizer.0002.northern
		trigger_event = {
			id = agot_house_customizer.0003
		}
	}

	#Displays Extinct Riverlander Houses
	option = {
		name = agot_house_customizer.0002.riverlands
		trigger_event = {
			id = agot_house_customizer.0004
		}
	}

	#Displays Extinct Vale Houses
	option = {
		name = agot_house_customizer.0002.vale
		trigger_event = {
			id = agot_house_customizer.0005
		}
	}

	#Displays Extinct Crownlands Houses
	option = {
		name = agot_house_customizer.0002.crownlands
		trigger_event = {
			id = agot_house_customizer.0006
		}
	}

	#Displays Extinct Stormlander Houses
	option = {
		name = agot_house_customizer.0002.stormlands
		trigger_event = {
			id = agot_house_customizer.0007
		}
	}

	#Displays Extinct Dorne Houses
	option = {
		name = agot_house_customizer.0002.dorne
		trigger_event = {
			id = agot_house_customizer.0008
		}
	}

	#Displays Extinct Dorne Houses
	option = {
		name = agot_house_customizer.0002.reach
		trigger_event = {
			id = agot_house_customizer.0009
		}
	}

	#Displays Extinct Dorne Houses
	option = {
		name = agot_house_customizer.0002.westerlands
		trigger_event = {
			id = agot_house_customizer.0010
		}
	}

	#Displays Extinct Ironborn Houses
	option = {
		name = agot_house_customizer.0002.ironborn
		trigger_event = {
			id = agot_house_customizer.0011
		}
	}

	option = {
		name = agot_house_customizer.back_option
		trigger_event = {
			id = agot_house_customizer.0001
		}
   }

}


### REGION SELECTION ###

#Select Extinct North
agot_house_customizer.0003 = {
	type = character_event
    title = agot_house_customizer.0003.t
    desc = agot_house_customizer.0003.desc

	theme = family

	override_background = {
		event_background = physicians_study
	}

	left_portrait = {
		character = root
		animation = throne_room_writer
	}

	right_portrait = {
		character = root
		animation = throne_room_writer
	}

	immediate = {
		play_music_cue = "mx_cue_succession"
	}

    #Amber
    option = {
       name = agot_house_customizer.0003.amber
       character:Amber_1 = {
           save_scope_as = hc_selection
       }
       trigger_event = agot_house_customizer.0020
    }

   option = {
       name = agot_house_customizer.0003.greenwood
       character:Greenwood_1 = {
           save_scope_as = hc_selection
       }
       trigger_event = agot_house_customizer.0020
   }

    #Frost
	option = {
		name = agot_house_customizer.0003.frost
		character:Frost_1 = {
			save_scope_as = hc_selection
		 }
		trigger_event = agot_house_customizer.0020 
   }

   	#Greystark
	   option = {
		name = agot_house_customizer.0003.greystark
		character:Greystark_10 = {
			save_scope_as = hc_selection
		 }
		trigger_event = agot_house_customizer.0020
   }

       #Woodfoot 
       option = {
       name = agot_house_customizer.0003.woodfoot
       character:Woodfoot_1 = {
           save_scope_as = hc_selection
       }
       trigger_event = agot_house_customizer.0020 
   }

   option = {
		name = agot_house_customizer.back_option
		trigger_event = {
			id = agot_house_customizer.0002
		}
   }

}

#Select Extinct Riverlands
agot_house_customizer.0004 = {
	type = character_event
    title = agot_house_customizer.0004.t
    desc = agot_house_customizer.0004.desc

	theme = family

	override_background = {
		event_background = physicians_study
	}

	left_portrait = {
		character = root
		animation = throne_room_writer
	}

	right_portrait = {
		character = root
		animation = throne_room_writer
	}

	immediate = {
		play_music_cue = "mx_cue_succession"
	}

	#fisher of riverlands
	option = {
		 name = agot_house_customizer.0004.fisher_riverlands
		 character:Fisher_riverlands_duplicate_8 = {
			save_scope_as = hc_selection
		 }
		trigger_event = agot_house_customizer.0020
	}

	#Harroway
	option = {
		name = agot_house_customizer.0004.harroway
		character:Harroway_8 = {
			save_scope_as = hc_selection
		 }
		trigger_event = agot_house_customizer.0020
   }

# 	#hook #AGOT TODO NEEDS AT LEAST ONE CHARACTER
# 	option = {
# 		name = agot_house_customizer.0004.hook
# 		character: = {
# 			save_scope_as = hc_selection
# 		 }
# 		trigger_event = agot_house_customizer.0020
#    }

   	#justman
	option = {
		name = agot_house_customizer.0004.justman
		character:Justman_8 = {
			save_scope_as = hc_selection
		 }
		trigger_event = agot_house_customizer.0020 
   }

   	#Qoherys
	option = {
		name = agot_house_customizer.0004.qoherys
		character:Qoherys_4 = {
			save_scope_as = hc_selection
		 }
		trigger_event = agot_house_customizer.0020
   }

   	#teague
	option = {
		name = agot_house_customizer.0004.teague
		character:Teague_6 = {
			save_scope_as = hc_selection
		 }
		trigger_event = agot_house_customizer.0020
   }

   	#towers_of_harrenhal
	option = {
		name = agot_house_customizer.0004.towers_of_harrenhal
		character:Towers_6 = {
			save_scope_as = hc_selection
		 }
		trigger_event = agot_house_customizer.0020
   }

   option = {
		name = agot_house_customizer.back_option
		trigger_event = {
			id = agot_house_customizer.0002
		}
   }

}

#Select Extinct Vale
agot_house_customizer.0005 = {
	type = character_event
    title = agot_house_customizer.0005.t
    desc = agot_house_customizer.0005.desc

	theme = family

	override_background = {
		event_background = physicians_study
	}

	left_portrait = {
		character = root
		animation = throne_room_writer
	}

	right_portrait = {
		character = root
		animation = throne_room_writer
	}

	immediate = {
		play_music_cue = "mx_cue_succession"
	}

	#shell
	option = {
		 name = agot_house_customizer.0005.shell
		 character:Shell_Vale_1 = {
			save_scope_as = hc_selection
		 }
		trigger_event = agot_house_customizer.0020
	}

	#brightstone
	option = {
		name = agot_house_customizer.0005.brightstone
		character:Brightstone_1 = {
			save_scope_as = hc_selection
		 }
		trigger_event = agot_house_customizer.0020
   }

   option = {
		name = agot_house_customizer.back_option
		trigger_event = {
			id = agot_house_customizer.0002
		}
   }

}

#Select Extinct Crownlands
agot_house_customizer.0006 = {
	type = character_event
    title = agot_house_customizer.0006.t
    desc = agot_house_customizer.0006.desc

	theme = family

	override_background = {
		event_background = physicians_study
	}

	left_portrait = {
		character = root
		animation = throne_room_writer
	}

	right_portrait = {
		character = root
		animation = throne_room_writer
	}

	immediate = {
		play_music_cue = "mx_cue_succession"
	}

	#Blackfyre
	option = {
		 name = agot_house_customizer.0006.blackfyre
		 character:Blackfyre_14 = {
			save_scope_as = hc_selection
		 }
		 trigger_event = agot_house_customizer.0020
	}

	#Bloodraven
	option = {
		 name = agot_house_customizer.0006.bloodraven
		 character:Targaryen_96 = {
			save_scope_as = hc_selection
		 }
		 trigger_event = agot_house_customizer.0020
	}
	
	#Bittersteel
	option = {
		 name = agot_house_customizer.0006.bittersteel
		 character:Targaryen_95 = {
			save_scope_as = hc_selection
		 }
		 trigger_event = agot_house_customizer.0020
	}
	
	#Seastar
	option = {
		 name = agot_house_customizer.0006.seastar
		 character:Targaryen_97 = {
			save_scope_as = hc_selection
		 }
		 trigger_event = agot_house_customizer.0020
	}

   	#darklyn
	option = {
		name = agot_house_customizer.0006.darklyn
		character:Darklyn_47 = {
			save_scope_as = hc_selection
		 }
		 trigger_event = agot_house_customizer.0020
   }

   	option = {
		name = agot_house_customizer.back_option
		trigger_event = {
			id = agot_house_customizer.0002
		}
   	}

}

#Select Extinct Stormlands
agot_house_customizer.0007 = {
	type = character_event
    title = agot_house_customizer.0007.t
    desc = agot_house_customizer.0007.desc

	theme = family

	override_background = {
		event_background = physicians_study
	}

	left_portrait = {
		character = root
		animation = throne_room_writer
	}

	right_portrait = {
		character = root
		animation = throne_room_writer
	}

	immediate = {
		play_music_cue = "mx_cue_succession"
	}

	#Durrandon
	option = {
		 name = agot_house_customizer.0007.durrandon
		 character:Durrandon_87 = {
			save_scope_as = hc_selection
		 }
		 trigger_event = agot_house_customizer.0020
	}


   option = {
		name = agot_house_customizer.back_option
		trigger_event = {
			id = agot_house_customizer.0002
		}
   }

}

##Select Extinct Dorne
agot_house_customizer.0008 = {
	type = character_event
    title = agot_house_customizer.0008.t
    desc = agot_house_customizer.0008.desc

	theme = family

	override_background = {
		event_background = physicians_study
	}

	left_portrait = {
		character = root
		animation = throne_room_writer
	}

	right_portrait = {
		character = root
		animation = throne_room_writer
	}

	immediate = {
		play_music_cue = "mx_cue_succession"
	}

# 	# #Briar #AGOT TODO NEEDS AT LEAST ONE CHARACTER
# 	option = {
# 		 name = agot_house_customizer.0008.briar
# 		 character: = {
# 			save_scope_as = hc_selection
# 		 }
# 		 trigger_event = agot_house_customizer.0020
# 	}

# 	#Brook #AGOT TODO NEEDS AT LEAST ONE CHARACTER
# 	option = {
# 		name = agot_house_customizer.0008.brook
# 		character: = {
# 			save_scope_as = hc_selection
# 		 }
# 		 trigger_event = agot_house_customizer.0020
#    }

	#Dryland
	option = {
		name = agot_house_customizer.0008.dryland
		character:Dryland_1 = {
			save_scope_as = hc_selection
		 }
		 trigger_event = agot_house_customizer.0020
   	}

	#holt #AGOT TODO NEEDS AT LEAST ONE CHARACTER
# 	option = {
# 		name = agot_house_customizer.0008.holt
# 		character: = {
# 			save_scope_as = hc_selection
# 		 }
# 		 trigger_event = agot_house_customizer.0020
#    }

# 	#hull #AGOT TODO NEEDS AT LEAST ONE CHARACTER
# 	option = {
# 		name = agot_house_customizer.0008.hull
# 		character: = {
# 			save_scope_as = hc_selection
# 		 }
# 		 trigger_event = agot_house_customizer.0020
#    }

# 	#lake #AGOT TODO NEEDS AT LEAST ONE CHARACTER
# 	option = {
# 		name = agot_house_customizer.0008.lake
# 		character: = {
# 			save_scope_as = hc_selection
# 		 }
# 		 trigger_event = agot_house_customizer.0020
#    }


# 	#wade #AGOT TODO NEEDS AT LEAST ONE CHARACTER
# 	option = {
# 		name = agot_house_customizer.0008.wade
# 		character: = {
# 			save_scope_as = hc_selection
# 		 }
# 		 trigger_event = agot_house_customizer.0020
#    }

   	option = {
		name = agot_house_customizer.back_option
		trigger_event = {
			id = agot_house_customizer.0002
		}
   	}

}

#Select Extinct Reach
agot_house_customizer.0009 = {
	type = character_event
    title = agot_house_customizer.0009.t
    desc = agot_house_customizer.0009.desc

	theme = family

	override_background = {
		event_background = physicians_study
	}

	left_portrait = {
		character = root
		animation = throne_room_writer
	}

	right_portrait = {
		character = root
		animation = throne_room_writer
	}

	immediate = {
		play_music_cue = "mx_cue_succession"
	}

	#Gardener 
	option = {
		 name = agot_house_customizer.0009.gardener
		 character:Gardener_95 = {
			save_scope_as = hc_selection
		 }
		 trigger_event = agot_house_customizer.0020
	}

   option = {
		name = agot_house_customizer.back_option
		trigger_event = {
			id = agot_house_customizer.0002
		}
   }

}

#Select Extinct Westerlands
agot_house_customizer.0010 = {
	type = character_event
    title = agot_house_customizer.0010.t
    desc = agot_house_customizer.0010.desc

	theme = family

	override_background = {
		event_background = physicians_study
	}

	left_portrait = {
		character = root
		animation = throne_room_writer
	}

	right_portrait = {
		character = root
		animation = throne_room_writer
	}

	immediate = {
		play_music_cue = "mx_cue_succession"
	}

	#Casterly 
	option = {
		 name = agot_house_customizer.0010.casterly
		 character:Casterly_7 = {
			save_scope_as = hc_selection
		 }
		 trigger_event = agot_house_customizer.0020
	}

	#Parren
	option = {
		name = agot_house_customizer.0010.parren
		character:Parren_17 = {
			save_scope_as = hc_selection
		 }
		trigger_event = agot_house_customizer.0020	
   }

	#reyne
	option = {
		name = agot_house_customizer.0010.reyne
		character:Reyne_45 = {
			save_scope_as = hc_selection
		 }
		 trigger_event = agot_house_customizer.0020
   }

   option = {
		name = agot_house_customizer.back_option
		trigger_event = {
			id = agot_house_customizer.0002
		}
   }

}

#Select extinct Ironborn
agot_house_customizer.0011 = {
	type = character_event
    title = agot_house_customizer.0011.t
    desc = agot_house_customizer.0011.desc

	theme = family

	override_background = {
		event_background = physicians_study
	}

	left_portrait = {
		character = root
		animation = throne_room_writer
	}

	right_portrait = {
		character = root
		animation = throne_room_writer
	}

	immediate = {
		play_music_cue = "mx_cue_succession"
	}

	#Greyiron 
	option = {
		 name = agot_house_customizer.0011.greyiron
		 character:Greyiron_32 = {
			save_scope_as = hc_selection
		 }
		trigger_event = agot_house_customizer.0020
	}

	#Hoare
	option = {
		name = agot_house_customizer.0011.hoare
		character:Hoare_31 = {
			save_scope_as = hc_selection
		 }
		trigger_event = agot_house_customizer.0020
   }

   option = {
		name = agot_house_customizer.back_option
		trigger_event = {
			id = agot_house_customizer.0002
		}
   }

}

# #Select extinct Valyria
# agot_house_customizer.0012 = {}

# #Essos?
# agot_house_customizer.0013 = {}

# #Far east?
# agot_house_customizer.0014 = {}

# #Other regions
# agot_house_customizer.0015 = {}

###HOUSE CONVERSION AND CHARACTER RELATION EVENTS

#This event handles the EXTINCT HOUSE conversion
agot_house_customizer.0020 = {
	type = character_event
    title = agot_house_customizer.0020.t
    desc = agot_house_customizer.0020.desc

	theme = family

	override_background = {
		event_background = study
	}

	left_portrait = {
		character = root
		animation = throne_room_writer
	}

	right_portrait = {
		character = scope:hc_selection
		animation = throne_room_writer
	}

	immediate = {
		play_music_cue = "mx_cue_succession"
		remove_trait = house_customizer
		every_held_title = { set_coa = scope:hc_selection.house }
	}

	#I want to play as their sibling 
	option = {
		 name = agot_house_customizer.0020.a

		 trigger = {
			OR = {
				exists = scope:hc_selection.mother
				exists = scope:hc_selection.father
			}
		 }

		 if = {
			limit = {
				scope:hc_selection.father.primary_title.tier >= scope:hc_selection.mother.primary_title.tier
			}
			set_father = scope:hc_selection.father
			set_house = scope:hc_selection.father.house
			set_dna_flag_of_dynasty = yes

		 } else = {
			set_mother = scope:hc_selection.mother
			set_house = scope:hc_selection.mother.house
			set_dna_flag_of_dynasty = yes
		 }

		 if = {
			limit = {
				any_child = { #If any child is not the same house
					NOT = {
						house = root.house
					}
				}
			}
			every_child = { #Then we scope to every possible child and set their house as YOUR house.
				limit = {
					NOT = {
						house = root.house
					}
				}
				set_house = root.house
				set_dna_flag_of_dynasty = yes
			}
		}

		trigger_event = { id = agot_house_customizer.0022}

		 #debugging
		 show_as_unavailable = {
			always = yes
		 }
	}

	#I want to play as their child
	option = {
		name = agot_house_customizer.0020.b
		trigger = {
			scope:hc_selection = {
				can_be_parent_of = root
			}
		}
		if = {
			limit = {
				scope:hc_selection = {
					is_male = yes
				}
			}
			set_father = scope:hc_selection
			set_house = scope:hc_selection.house
			set_dna_flag_of_dynasty = yes
		} else = {
			set_mother = scope:hc_selection
			set_house = scope:hc_selection.house
			set_dna_flag_of_dynasty = yes
		}

		if = {
			limit = {
				any_child = { #If any child is not the same house
					NOT = {
						house = root.house
					}
				}
			}
			every_child = { #Then we scope to every possible child and set their house as YOUR house.
				limit = {
					NOT = {
						house = root.house
					}
				}
				set_house = root.house
				set_dna_flag_of_dynasty = yes
			}
		}

		trigger_event = { id = agot_house_customizer.0022}
   }

   #I want to play as their relative
   option = {
		name = agot_house_customizer.0020.c
		trigger = {
			scope:hc_selection = {
				any_close_or_extended_family_member = {
					even_if_dead = yes
					#limit = {
						is_adult = yes
						house = scope:hc_selection.house
					#}				
				}
			}
		}

		scope:hc_selection = {
			every_close_or_extended_family_member = {
				even_if_dead = yes
				limit = {
					is_adult = yes
					house = scope:hc_selection.house
				}
				add_to_list = house_customizer_random_relative_list
				debug_log = "House Customizer: Populating Random Relative List..."
			}
		}

		random_in_list = {
			list = house_customizer_random_relative_list
			save_scope_as = hc_random_relative_selection
		}

		if = {
			limit = {
				scope:hc_random_relative_selection = { #Determines who your parent should be
					is_male = yes
				}
			}
			set_father = scope:hc_random_relative_selection 
		} else = {
			set_mother = scope:hc_random_relative_selection
		}

		set_house = scope:hc_random_relative_selection.house #Set's the player's house to the selection's house
		set_dna_flag_of_dynasty = yes
		
		if = {
			limit = {
				any_child = { #If any child is not the same house
					NOT = {
						house = root.house
					}
				}
			}
			every_child = { #Then we scope to every possible child and set their house as YOUR house.
				limit = {
					NOT = {
						house = root.house
					}
				}
				set_house = root.house
				set_dna_flag_of_dynasty = yes
			}
		}

		trigger_event = { id = agot_house_customizer.0022}
   }	
}

#Used for the interaction for living characters
agot_house_customizer.0021 = {
	type = character_event
    title = agot_house_customizer.0020.t
    desc = agot_house_customizer.0020.desc

	theme = family

	override_background = {
		event_background = study
	}

	left_portrait = {
		character = root
		animation = throne_room_writer
	}

	right_portrait = {
		character = scope:hc_selection
		animation = throne_room_writer
	}

	immediate = {
		play_music_cue = "mx_cue_succession"
		scope:recipient = {
			save_scope_as = hc_selection
		}
		remove_trait = house_customizer
		every_held_title = { set_coa = scope:hc_selection.house }
	}

	#I want to play as their sibling 
	option = {
		 name = agot_house_customizer.0020.a

		 trigger = {
			OR = {
				exists = scope:hc_selection.mother
				exists = scope:hc_selection.father
			}
		 }

		 if = {
			limit = {
				scope:hc_selection.father.primary_title.tier >= scope:hc_selection.mother.primary_title.tier
			}
			set_father = scope:hc_selection.father
			set_house = scope:hc_selection.father.house
			set_dna_flag_of_dynasty = yes
		 } else = {
			set_mother = scope:hc_selection.mother
			set_house = scope:hc_selection.mother.house
			set_dna_flag_of_dynasty = yes
		 }

		 if = {
			limit = {
				any_child = { #If any child is not the same house
					NOT = {
						house = root.house
					}
				}
			}
			every_child = { #Then we scope to every possible child and set their house as YOUR house.
				limit = {
					NOT = {
						house = root.house
					}
				}
				set_house = root.house
			}
		}

		 #debugging
		 show_as_unavailable = {
			always = yes
		 }
	}

	#I want to play as their child
	option = {
		name = agot_house_customizer.0020.b
		trigger = {
			scope:hc_selection = {
				can_be_parent_of = root
			}
		}
		if = {
			limit = {
				scope:hc_selection = {
					is_male = yes
				}
			}
			set_father = scope:hc_selection
			set_house = scope:hc_selection.house
			set_dna_flag_of_dynasty = yes
			
		} 
		else = {
			set_mother = scope:hc_selection
			set_house = scope:hc_selection.house
			set_dna_flag_of_dynasty = yes
		}

		if = {
			limit = {
				any_child = { #If any child is not the same house
					NOT = {
						house = root.house
					}
				}
			}
			every_child = { #Then we scope to every possible child and set their house as YOUR house.
				limit = {
					NOT = {
						house = root.house
					}
				}
				set_house = root.house
				set_dna_flag_of_dynasty = yes
			}
		}
   }

   #I want to play as their relative
   option = {
		name = agot_house_customizer.0020.c
		trigger = {
			scope:hc_selection = {
				any_close_or_extended_family_member = {
					even_if_dead = yes
					#limit = {
						is_adult = yes
						house = scope:hc_selection.house
					#}				
				}
			}
		}

		scope:hc_selection = {
			every_close_or_extended_family_member = {
				even_if_dead = yes
				limit = {
					is_adult = yes
					house = scope:hc_selection.house
				}
				add_to_list = house_customizer_random_relative_list
				debug_log = "House Customizer: Populating Random Relative List..."
			}
		}

		random_in_list = {
			list = house_customizer_random_relative_list
			save_scope_as = hc_random_relative_selection
		}

		set_house = scope:hc_random_relative_selection.house
		set_dna_flag_of_dynasty = yes
		if = {
			limit = {
				scope:hc_random_relative_selection = {
					is_male = yes
				}
			}
			set_father = scope:hc_random_relative_selection
		} else = {
			set_mother = scope:hc_random_relative_selection
		}
		
		if = {
			limit = {
				any_child = { #If any child is not the same house
					NOT = {
						house = root.house
					}
				}
			}
			every_child = { #Then we scope to every possible child and set their house as YOUR house.
				limit = {
					NOT = {
						house = root.house
					}
				}
				set_house = root.house
				set_dna_flag_of_dynasty = yes
			}
		}
   }
   
   option = { # I want to play as Aerys' child
		name = agot_house_customizer.0020.d
		trigger = {
			scope:hc_selection = character:Targaryen_120
			game_start_date = 8284.6.2
		}
		set_dna_flag_of_dynasty = yes
		set_house = scope:hc_selection.house
		set_father = character:Targaryen_1	
   }
   option = { # I want to play as Rhaegar's child
		name = agot_house_customizer.0020.e
		trigger = {
			scope:hc_selection = character:Targaryen_120
			game_start_date = 8284.6.2
			character:Targaryen_3 = {
				can_be_parent_of = root
			}
		}
		set_dna_flag_of_dynasty = yes
		set_house = scope:hc_selection.house
		set_father = character:Targaryen_3	
   }
}

agot_house_customizer.0022 = {
	type = character_event
	hidden = yes

	immediate = {
		## NORTH ##
		scope:hc_amber = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_greenwood = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_frost = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_greystark = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_woodfoot = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		## TRIDENT ##
		scope:hc_fisher_trident = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_harroway = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_justman = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_qoherys = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_teague = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_towers = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		## VALE ##
		scope:hc_shell_vale = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_brightstone = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		## Crownlands ##
		scope:hc_blackfyre = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_darklyn = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		## STORMLANDS ##
		scope:hc_durrandon = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		## DORNE ##
		scope:hc_dryland = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		## REACH ##
		scope:hc_gardener = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		## WESTERLANDS ##
		scope:hc_casterly = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_parren = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_reyne = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		## iron islands ##
		scope:hc_greyiron = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_hoare = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		trigger_event = {
			id = agot_house_customizer.0023
			days = 1
		}
	}
}

agot_house_customizer.0023 = {
	type = character_event
	hidden = yes

	immediate = {
		every_in_list = {
			list = extinct_house_population_list
			set_to_lowborn = yes
		}
	}
}

agot_house_customizer.0024 = {
	type = empty
	hidden = yes

	immediate = {
		## NORTH ##
		scope:hc_amber = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_greenwood = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_frost = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_greystark = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_woodfoot = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		## TRIDENT ##
		scope:hc_fisher_trident = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_harroway = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_justman = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_qoherys = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_teague = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_towers = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		## VALE ##
		scope:hc_shell_vale = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_brightstone = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		## Crownlands ##
		scope:hc_blackfyre = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_darklyn = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		## STORMLANDS ##
		scope:hc_durrandon = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		## DORNE ##
		scope:hc_dryland = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		## REACH ##
		scope:hc_gardener = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		## WESTERLANDS ##
		scope:hc_casterly = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_parren = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_reyne = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		## iron islands ##
		scope:hc_greyiron = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		scope:hc_hoare = {
			death = {
				death_reason = death_duel
			}
			add_to_list = extinct_house_population_list
		}
		trigger_event = {
			id = agot_house_customizer.0025
			days = 1
		}
	}
}

agot_house_customizer.0025 = {
	type = empty
	hidden = yes

	immediate = {
		every_in_list = {
			list = extinct_house_population_list
			set_to_lowborn = yes
		}
	}
}
