﻿#############################################################
# 
# 
# 
# DUNHUANG
# 
# 
# 
#############################################################
#############################################################
# 
# CAO FAMILY
# 
#############################################################
# Cao Yijin's mother, real name unknown - member of the Yin family, not sure how connected, but made to be Wentong's daughter, given Wentong's role in overthrowing Tibetan rule
#############################################################
# 
# LI FAMILY
# 
#############################################################
# Li Mingzhen - exists in vanilla
# Either he or his sons were involved in the coup against Suo Xun, who happened to be both his wife's nephew AND his wife's brother-in-law somehow
# Married Zhang Yichao's daughter (Zhang Yichao was born in 799)
# Li Hongding, Mingzhen's son. Not sure if older or younger than brothers, or if he was one of Li Mingzhen's sons involved in the coup against the Suo.
# RICE_li_001 = {
#   name = "弘定" 	# Hongding
#   dynasty = 2003012
#   religion = "mahayana"
#   culture = "han"
#   father = 304192
#   mother = RICE_zhang_001
#   trait = education_stewardship_3
#   trait = intellect_good_1
#   trait = scholar
#   858.12.17 = {
#     birth = yes
#   }
#   919.5.6 = { 	#  unknown
#     death = yes
#   }
# }
# # Mingzhen's father
# RICE_li_002 = {
#   name = "恩" 	# En
#   dynasty = 2003012
#   religion = "mahayana"
#   culture = "han"
#   father = RICE_li_003
#   trait = education_martial_2
#   801.3.22 = { 	#  unknown
#     birth = yes
#   }
#   855.5.2 = { 	#  unknown
#     death = yes
#   }
# }
# # Mingzhen's grandfather
# RICE_li_003 = {
#   name = "炜" 	# Wei
#   dynasty = 2003012
#   religion = "mahayana"
#   culture = "han"
#   father = RICE_li_004
#   trait = education_martial_2
#   774.7.17 = { 	#  unknown
#     birth = yes
#   }
#   819.6.3 = { 	#  unknown
#     death = yes
#   }
# }
# # Mingzhen's great-grandfather, a prominent member of the Li clan in the 8th century
# # Built Mogao Cave 148
# # Married the daughter of Yin Tingjie, attested in 776 as a major Dunhuang official assigned as a local service recruiter
# RICE_li_004 = {
#   name = "达彬" 	# Dabin
#   dynasty = 2003012
#   religion = "mahayana"
#   culture = "han"
#   741.9.15 = { 	#  Built a cave in 777, so was an adult by then
#     birth = yes
#   }
#   804.2.6 = { 	#  unknown
#     death = yes
#   }
# }
# # Mingzhen's brother Mingda
# # Joined Mingzhen's delegation to the Tang court on behalf of Zhang Yichao in the 850s
# # Also held military posts
# RICE_li_005 = {
#   name = "明达" 	# Mingda
#   dynasty = 2003012
#   religion = "mahayana"
#   culture = "han"
#   diplomacy = 8
#   trait = education_martial_2
#   father = RICE_li_002
#   839.9.20 = { 	#  unknown
#     birth = yes
#   }
#   881.12.14 = { 	#  unknown
#     death = yes
#   }
# }
# # Mingzhen's other brother who was a military officer
# # Don't know his name, but presumably it begins with Ming
# RICE_li_006 = {
#   name = "明昌" 	# Mingchang
#   dynasty = 2003012
#   religion = "mahayana"
#   culture = "han"
#   trait = education_martial_2
#   father = RICE_li_002
#   845.7.12 = { 	#  Unknown
#     birth = yes
#   }
#   911.6.24 = { 	#  Unknown
#     death = yes
#   }
# }
# # Li Mingzhen's daughter, name unknown
# RICE_li_007 = {
#   name = "NU_ying"
#   female = yes
#   dynasty = 2003012
#   religion = "mahayana"
#   culture = "han"
#   father = 304192
#   mother = RICE_zhang_001
#   862.12.23 = { 	#  Unknown
#     birth = yes
#   }
#   909.12.17 = { 	#  Unknown
#     death = yes
#   }
# }
# # Li Mingzhen's son, involved in coup - unknown names so name here is fictitious; four known sons, three dead by 900
# # Not sure if killed in counter-coup or not
# # Li Mingzhen's son, involved in coup - unknown names so name here is fictitious; four known sons, three dead by 900
# # Not sure if killed in counter-coup or not
# # Li Mingzhen's son, involved in coup - unknown names so name here is fictitious; four known sons, three dead by 900
# # Not sure if killed in counter-coup or not
# ######################################################################
# # 
# # YIN FAMILY - The Loyal Merchants, who learned their lesson after Yin Jian's death and Yin Dan's humiliation. Intermarried with Sogdians, including the Shi families.
# # A number of characters are fictitious, particularly early on, to connect characters
# # 
# ######################################################################
# # Wentong, descendant of Yin Sijian, married to Zhang Yichao's daughter; military official who helped Zhang Yichao to overthrow Tibetan rule
# # Married Zhang Yichao's daughter
# RICE_yin_001 = {
#   name = "文通" 	# Wentong
#   dynasty = RICE_yin
#   religion = "mahayana"
#   culture = "han"
#   trait = education_martial_3
#   trait = brave
#   trait = content
#   820.5.12 = { 	#  unknown
#     birth = yes
#   }
#   855.1.1 = {
#     add_spouse = RICE_yin_002
#   }
#   909.3.4 = { 	#  unknown
#     death = yes
#   }
# }
# #Zhang Yichao's daughter, fictional name
# RICE_yin_002 = {
#   name = "华" 	# Guiying
#   female = yes
#   dynasty = 1055006 	# ZHANG
#   religion = "mahayana"
#   culture = "han"
#   father = 206811
#   mother = RICE_song_002
#   835.7.16 = { 	#  unknown
#     birth = yes
#   }
#   905.3.25 = { 	#  unknown
#     death = yes
#   }
# }
# # Jifeng, not sure where he is in the family tree, placed here for convenience; official under Zhang Yichao and later helped Zhang family reclaim their rule in the late 800s
# RICE_yin_003 = {
#   name = "季丰" 	# Jifeng
#   dynasty = RICE_yin
#   religion = "mahayana"
#   culture = "han"
#   trait = education_stewardship_3
#   842.1.2 = { 	#  unknown
#     birth = yes
#   }
#   905.4.8 = { 	#  unknown
#     death = yes
#   }
# }
# # Jifeng's son, a monk
# RICE_yin_004 = {
#   name = "海晏" 	# Haiyan
#   dynasty = RICE_yin
#   religion = "mahayana"
#   culture = "han"
#   trait = devoted
#   father = RICE_yin_003
#   trait = education_learning_3
#   870.1.2 = { 	#  Unknown, but at least an adult in 901 as the overall overseer of monks
#     birth = yes
#   }
#   933.1.6 = { 	#  actual date
#     death = yes
#   }
# }
# # Yin Jiazheng - son of Suo mother, father is Yin Bolun
# ######################################################################
# # 
# # SUO FAMILY - The Learned and Ancient clan, descended from a long line of famous calligraphers, most prominently Suo Jing.
# # Also provided a number of important military officials during the Guiyi era
# # Most important member in CK2 timeframe was Suo Xun, who briefly usurped the Guiyi Circuit in the 890s.
# # Information is extremely scarce, so many of the characters are fictitious
# # 
# ######################################################################
# # Suo Xun, uncertain how he is connected to rest of family. He was the man who led a coup against the Zhang and overthrew them for a few years but was killed in c. 894.
# # His maternal aunt was a daughter of Zhang Yichao who was married to Li Mingzhen, i.e. his mother was Zhang Yichao's daughter.
# # However, he was also a son-in-law of Zhang Yichao, meaning he married another daughter of Zhang Yichao, meaning he married his aunt.
# # - exists in vanilla
# # Suo Qingyu
# RICE_suo_001 = {
#   name = "清裕" 	# Qingyu
#   dynasty = 2003011 	# Suo
#   religion = "mahayana"
#   culture = "han"
#   trait = education_martial_2
#   779.4.15 = { 	#  Unknown, but was in charge of public security during the Tibetan occupation
#     birth = yes
#   }
#   852.5.28 = { 	#  Unknown
#     death = yes
#   }
# }
# # Wife of Zhang Yitan, Zhang Yichao's older brother; member of Suo family, unknown lineage so I made her Suo Qingyu's daughter
# RICE_suo_002 = {
#   name = "小怜" 	# Xiaolian
#   female = yes
#   dynasty = 2003011 	# Suo
#   religion = "mahayana"
#   culture = "han"
#   father = RICE_suo_001
#   802.3.6 = {
#     birth = yes
#   }
#   818.5.2 = {
#     add_spouse = 304187
#   }
#   864.3.5 = { 	#  Unknown
#     death = yes
#   }
# }
# # Suo Qingyu's first son, name unknown, but since his brothers all had names starting with Zhong
# RICE_suo_003 = {
#   name = "忠臣" 	# Zhongchen
#   dynasty = 2003011 	# Suo
#   religion = "mahayana"
#   culture = "han"
#   father = RICE_suo_001
#   808.5.20 = { 	#  Unknown
#     birth = yes
#   }
#   858.8.2 = { 	#  Unknown
#     death = yes
#   }
# }
# # Suo Zhongyi, Suo Qingyu's second son, commander of the garrison in Liangzhou
# RICE_suo_004 = {
#   name = "忠顗" 	# Zhongyi
#   dynasty = 2003011 	# Suo
#   religion = "mahayana"
#   culture = "han"
#   father = RICE_suo_001
#   trait = education_martial_3
#   815.5.28 = { 	#  Unknown
#     birth = yes
#   }
#   866.1.30 = { 	#  Unknown
#     death = yes
#   }
# }
# # Suo Zhongxin, close attendant of Zhang Yichao
# RICE_suo_005 = {
#   name = "忠信" 	# Zhongxin
#   dynasty = 2003011 	# Suo
#   religion = "mahayana"
#   culture = "han"
#   father = RICE_suo_001
#   822.5.1 = { 	#  Unknown
#     birth = yes
#   }
#   840.1.1 = {
#     effect = {
#       set_relation_friend = {
#         target = character:206811
#         reason = RICE_friend_reason_placeholder
#       }
#     }
#   }
#   876.4.15 = { 	#  Unknown
#     death = yes
#   }
# }
# # Suo Hanjun, garrison commander in Suzhou in 884
# # Relation uncertain so I just made him Suo Qingyu's grandson through the first son
# RICE_suo_006 = {
#   name = "汉君" 	# Hanjun
#   dynasty = 2003011 	# Suo
#   religion = "mahayana"
#   culture = "han"
#   #father=RICE_suo_003
#   trait = education_martial_2
#   842.9.12 = { 	#  Unknown
#     birth = yes
#   }
#   909.10.14 = { 	#  Unknown
#     death = yes
#   }
# }
# # Lady Suo, Cao Yijin's wife and Suo Xun's daughter
# # Name unknown
# RICE_suo_007 = {
#   name = "浣英" 	# Wanying
#   female = yes
#   dynasty = 2003011 	# Suo
#   religion = "mahayana"
#   culture = "han"
#   father = 304191
#   mother = 304190
#   860.10.1 = { 	#  Unknown
#     birth = yes
#   }
#   # 866.1.1 = {
#   # 	effect = {
#   # 		create_betrothal = character:1059714
#   # 	}
#   # }
#   933.3.6 = { 	#  Unknown
#     death = yes
#   }
# }
# # Suo Xun's son, mysteriously wasn't killed after the counter-coup against his father - might have been involved in the coup in fact, though this might be speculative
# RICE_suo_008 = {
#   name = "承训" 	# Chengxun
#   dynasty = 2003011 	# Suo
#   religion = "mahayana"
#   culture = "han"
#   father = 304191
#   mother = 304190
#   863.5.7 = { 	#  Unknown
#     birth = yes
#   }
#   942.11.19 = { 	#  Unknown
#     death = yes
#   }
# }
######################################################################
# 
# ZHAI FAMILY - Relatively newer clan that came to Dunhuang in the late 6th century.
# Most important member in CK2 timeframe was Zhai Fengda, who attained high office in the Cao regime.
# See Susan Whitfield's "Life Along the Silk Road" for more - she has one chapter devoted entirely to Zhai Fengda!
# The characterization of Zhai Fengda and his father here is based on Whitfield's quasi-historical's imagining.
# 
######################################################################
# Note: earliest named ancestor of Zhai Fengda I could find is a 9th generation ancestor, Zhai Siyuan/Tong, who sponsored a Mogao cave c. 642
# However he is not depicted here because couldn't get the name of anyone else
# Fictitious to link together Nanli together with Farong and Farong's brother Chengqing
RICE_zhai_001 = {
  name = "梁" 	# Liang
  dynasty = RICE_zhai
  religion = "mahayana"
  culture = "han"
  777.7.7 = { 	#  Unknown
    birth = yes
  }
  844.2.21 = { 	#  Unknown
    death = yes
  }
}
# Nanli, major donor mentioned in the Zhai family cave c. 857 CE who made offerings on his parents' behalf, so *probably* a member of the Zhai family or related somehow
# Nothing suggests he's Fengda's grandfather/Xin's father, so the relationship is fictitious to ensure characters are connected
# Nor that he is Farong and Chengqing's sibling, however again just to connect the characters
RICE_zhai_002 = {
  name = "南立" 	# Nanli
  dynasty = RICE_zhai
  religion = "mahayana"
  culture = "han"
  father = RICE_zhai_001
  808.5.2 = { 	#  Unknown, but at least an adult in 857
    birth = yes
  }
  864.2.1 = { 	#  Unknown
    death = yes
  }
}
# Zhai Farong, who sponsored the construction of Mogao Cave 85
# Important leading figure of the family of his generation so I made him Nanli's brother
# Was the chief monk of the region with Wuzhen as his deputy until Wuzhen took over
RICE_zhai_003 = {
  name = "法荣" 	# Farong
  dynasty = RICE_zhai
  religion = "mahayana"
  culture = "han"
  diplomacy = 6
  martial = 2
  learning = 7
  trait = education_learning_3
  trait = zealous
  trait = diligent
  trait = gregarious
  trait = devoted
  trait = lifestyle_physician
  father = RICE_zhai_001
  802.8.5 = { 	#  Unknown, but at least an adult in c. 865 and senior to Wuzhen who was born 816
    birth = yes
  }
  869.7.13 = { 	#  Found somewhere that says he died in 869, though unsure of how valid that is - Wuzhen did attain his position in 870, so there's that
    death = yes
  }
}
# Huixin or Xin - Fengda's father, died by 925 - clerk in the local government; characterization loosely based on Whitfield's work
RICE_zhai_004 = {
  name = "信" 	# Xin
  dynasty = RICE_zhai
  religion = "mahayana"
  culture = "han"
  father = RICE_zhai_002
  trait = education_stewardship_2
  trait = diligent
  trait = compassionate
  trait = humble
  846.1.30 = { 	#  Unknown
    birth = yes
  }
  921.10.2 = { 	#  Unknown
    death = yes
  }
}
# Shende - Died by 925 - Xin's brother
RICE_zhai_005 = {
  name = "深德" 	# Shende
  dynasty = RICE_zhai
  religion = "mahayana"
  culture = "han"
  father = RICE_zhai_002
  857.3.30 = { 	#  Unknown
    birth = yes
  }
  923.11.5 = { 	#  Unknown
    death = yes
  }
}
# Wenzi - Died by 925 - Zhai Fengda's older brother
RICE_zhai_006 = {
  name = "文孜" 	# Wenzi
  dynasty = RICE_zhai
  religion = "mahayana"
  culture = "han"
  father = RICE_zhai_004
  trait = education_stewardship_2 	#  Also an official
  877.2.4 = { 	#  Unknown
    birth = yes
  }
  924.6.16 = { 	#  Unknown
    death = yes
  }
}
# Zhai Fengda himself
RICE_zhai_007 = {
  name = "奉达" 	# Fengda
  dynasty = RICE_zhai
  religion = "mahayana"
  culture = "han"
  father = RICE_zhai_004
  trait = education_stewardship_3 	#  Started as a clerk like his father, but much more successful in the long run, and had a better education
  trait = poet 	#  Amateur poet - funnily enough, as an older man, when he found a poem he wrote in his youth, he added the following very relatable note to the poem for anyone who writes: "I was but twenty years when I composed this poem. This year, happening upon it again, I am overcome with shame."
  trait = scholar 	#  Most notable scholarly contributions were in terms of calendars and astronomy, and in fact attained extremely rank through this
  trait = intellect_good_2 	#  Did not have the aptitude to pass the Imperial exams, yet was able to achieve high office in Dunhuang partly through his academic and professional career, meaning he must've been intelligent
  trait = zealous 	#  Devout Buddhist
  trait = compassionate 	#  Sponsored some sort of cave for his wife?
  #trait=erudite		# Your classic Confucian scholar-gentry
  trait = generous 	#  Frequently donated to Buddhist monasteries, and once made a large donation to the poor
  883.2.5 = {
    birth = yes
  }
  966.4.13 = {
    death = yes
  }
}
# Married to Cao Yuanzhong - not sure how she's connected to the family, so I made her Zhai Fengda's daughter so her age aligns with her husband's properly; still alive as of 966; name unknown
RICE_zhai_008 = {
  name = "琼仙" 	# Qiongxian
  dynasty = RICE_zhai
  female = yes
  religion = "mahayana"
  culture = "han"
  father = RICE_zhai_007
  915.11.19 = { 	#  Unknown, but have to put it at this year so Cao Zongshou's birth year would make sense
    birth = yes
  }
  937.1.5 = {
    add_spouse = 1059718
  }
  988.2.26 = { 	#  Unknown
    death = yes
  }
}
# Fengda's younger brother - still alive in 925, probably
RICE_zhai_009 = {
  name = "文忠" 	# Wenzhong
  dynasty = RICE_zhai
  religion = "mahayana"
  culture = "han"
  father = RICE_zhai_004
  884.6.12 = { 	#  Unknown
    birth = yes
  }
  935.2.24 = { 	#  Unknown
    death = yes
  }
}
# Fengda's son, dead by 925
RICE_zhai_010 = {
  name = "胜寇" 	# Shenkou
  dynasty = RICE_zhai
  religion = "mahayana"
  culture = "han"
  father = RICE_zhai_007
  900.2.3 = { 	#  Unknown
    birth = yes
  }
  924.8.30 = { 	#  Unknown
    death = yes
  }
}
# Fengda's grandson, also dead by 925 - not sure if Shenkou's son, but have made him Shenkou's son here
RICE_zhai_011 = {
  name = "鼎孜" 	# Dingzi
  dynasty = RICE_zhai
  religion = "mahayana"
  culture = "han"
  father = RICE_zhai_010
  917.11.4 = { 	#  Unknown
    birth = yes
  }
  923.12.27 = { 	#  Unknown
    death = yes
  }
}
# Farong's brother Chengqing
RICE_zhai_012 = {
  name = "承庆" 	# Chengqing
  dynasty = RICE_zhai
  religion = "mahayana"
  culture = "han"
  father = RICE_zhai_001
  810.1.23 = { 	#  Unknown, but was an adult with adult (?) sons in c. 865
    birth = yes
  }
  866.6.6 = { 	#  Unknown
    death = yes
  }
}
# Chengqing son Huaiguan, whose grandchildren, along with the grandchildren of his brother Huai'en, restored Cave 85 in Mogao between 924 and 931
RICE_zhai_013 = {
  name = "怀光" 	# Huaiguan
  dynasty = RICE_zhai
  religion = "mahayana"
  culture = "han"
  father = RICE_zhai_012
  844.4.2 = { 	#  Unknown, but his grandchildren were adults by 924
    birth = yes
  }
  862.1.1 = {
    add_spouse = RICE_zhai_015
  }
  909.9.30 = { 	#  Unknown
    death = yes
  }
}
# Chengqing son Huai'en, whose grandchildren, along with the grandchildren of his brother Huaiguan, restored Cave 85 in Mogao between 924 and 931
RICE_zhai_014 = {
  name = "Huai_en"
  dynasty = RICE_zhai
  religion = "mahayana"
  culture = "han"
  father = RICE_zhai_012
  852.8.25 = { 	#  Unknown, but his grandchildren were adults by 924
    birth = yes
  }
  911.2.3 = { 	#  Unknown
    death = yes
  }
}
# Zhang Yichao's niece who married into the Zhai family
# Attested in some caves during the early Five Dynasties period
# Can't find anything about her name or which Zhai member she married, only that she died before 924-925
# Therefore, I've made her Yitan's youngest daughter and married to Huaiguan
# RICE_zhai_015 = {
#   name = "梵境" 	# Fanjing
#   female = yes
#   dynasty = 1055006 	# ZHANG
#   religion = "mahayana"
#   culture = han
#   father = 304187
#   mother = RICE_suo_002
#   840.1.25 = { 	#  Unknown, but was Zhang Yichao's niece
#     birth = yes
#   }
#   922.2.12 = { 	#  Unknown but before 924
#     death = yes
#   }
# }
# ######################################################################
# # 
# # FAN FAMILY - Not that much information available, but apparently one of the major elite families of Dunhuang
# # A lot of fictitious characters to connect the few known ones
# # 
# ######################################################################
# ###########################################################################
# # 
# # ZHANG FAMILY EXPANSION
# # Other members of the Zhang family
# # 
# ###########################################################################
# # Zhang Yichao's daughter, married to Li Mingzhen, one of the leaders of a revolt against Suo Xun when he usurped Dunhuang; name unknown
# RICE_zhang_001 = {
#   name = "滔滔" 	# Taotao
#   dynasty = 1055006 	# ZHANG
#   female = yes
#   religion = "mahayana"
#   culture = "han"
#   father = 206811
#   mother = RICE_song_002
#   trait = education_intrigue_4
#   trait = brave
#   trait = diligent
#   trait = just
#   trait = stubborn
#   837.1.8 = { 	#  Unknown
#     birth = yes
#   }
#   858.1.1 = {
#     add_spouse = 304192
#   }
#   906.4.26 = { 	#  Unknown
#     death = yes
#   }
# }
# # Zhang Yichao's daughter, mother of Suo Xun, so I made her married to Suo Yiben (who is Suo Xun's father in-game, though the two men's actual relationship is unknown)
# # Since Suo Xun married another daughter of Zhang Yichao, that means he married his own aunt lol
# # Even if Suo Xun wasn't this inbred IRL, the elite clans of Dunhuang were hella inbred given they were around since the Han Dynasty
# # RICE_zhang_002 = {
# # 	name="Xian_e"
# # 	dynasty = 1055006 #ZHANG
# # 	female=yes
# # 	religion="mahayana"
# # 	culture="han"
# # 	father = 206811
# # 	mother=RICE_song_002
# # 	820.5.10={ # Unknown
# # 		birth=yes
# # 	}
# # 	839.1.1 = {
# # 		add_spouse = RICE_suo_004
# # 	}
# # 	879.10.14={ # Unknown
# # 		death=yes
# # 	}
# # }
# # Zhang Huaishen's son - may have been the actual killer of Huaishen and not Suo Xun, but this is uncertain
# RICE_zhang_003 = {
#   name = "延兴" 	# Yanxing
#   dynasty = 1055006 	# ZHANG
#   religion = "mahayana"
#   culture = "han"
#   father = 244004
#   mother = RICE_chen_001 	#  Likely son of a concubine as Lady Chen wasn't his mother, but she is here for convenience and neatness
#   839.1.11 = { 	#  Unknown
#     birth = yes
#   }
#   892.1.1 = { 	#  Unknown
#     death = {
#       death_reason = death_mysterious
#     }
#   }
# }
# # Zhang Huaishen's son - may have been the actual killer of Huaishen and not Suo Xun, but this is uncertain
# RICE_zhang_004 = {
#   name = "延嗣" 	# Yansi
#   dynasty = 1055006 	# ZHANG
#   religion = "mahayana"
#   culture = "han"
#   father = 244004
#   mother = RICE_chen_001 	#  Likely son of a concubine as Lady Chen wasn't his mother, but she is here for convenience and neatness
#   842.2.5 = { 	#  Unknown
#     birth = yes
#   }
#   892.1.1 = { 	#  Unknown
#     death = {
#       death_reason = death_mysterious
#     }
#   }
# }
# # Zhang Huaishen's son
# RICE_zhang_005 = {
#   name = "延晖" 	# Yanhui
#   dynasty = 1055006 	# ZHANG
#   religion = "mahayana"
#   culture = "han"
#   father = 244004
#   mother = RICE_chen_001 	#  Likely son of a concubine as Lady Chen wasn't his mother, but she is here for convenience and neatness
#   844.4.2 = { 	#  Unknown
#     birth = yes
#   }
#   892.1.1 = { 	#  Unknown
#     death = {
#       death_reason = death_mysterious
#     }
#   }
# }
# # Zhang Huaishen's son
# RICE_zhang_006 = {
#   name = "延礼" 	# Yanli
#   dynasty = 1055006 	# ZHANG
#   religion = "mahayana"
#   culture = "han"
#   father = 244004
#   mother = RICE_chen_001 	#  Likely son of a concubine as Lady Chen wasn't his mother, but she is here for convenience and neatness
#   846.6.3 = { 	#  Unknown
#     birth = yes
#   }
#   892.1.1 = { 	#  Unknown
#     death = {
#       death_reason = death_mysterious
#     }
#   }
# }
# # Huaishen had four sons total, but can't find the names of the others
# # Zhang Xishou - Important monk official who had good relations with Zhang Yichao, unknown if related to Zhang Yichao, but I've included him so there's more Zhang family members
# # Zhang Qiantao - Prominent member of the literati c. 864, unknown if related to Zhang Yichao, but I've included him so there's more Zhang family members
# # Zhang Qianyi - Zhang Yichao's father, official under Tibetans
# ###########################################################
# # 
# # CHEN FAMILY
# # Prominent Dunhuang family, but don't have many names
# # 
# ###########################################################
# # Zhang Huaishen's wife, was apparently not killed when he was
# RICE_chen_001 = {
#   name = "秉懿" 	# Bingyi
#   female = yes
#   dynasty = RICE_chen
#   religion = "mahayana"
#   culture = "han"
#   821.5.28 = { 	#  Unknown
#     birth = yes
#   }
#   838.1.1 = {
#     add_spouse = 244004
#   }
#   900.9.9 = { 	#  Unknown
#     death = yes
#   }
# }
# ###########################################################
# # 
# # AN FAMILY
# # Lived in Dunhuang for generations, pretty Sinicized
# # Not to be confused with An Lushan, etc. - An was a common surname given to Iranians, implying those probably originally from Parthia, as it was called Anxi
# # 
# ###########################################################
# # Zhang Yichao's mother, name unknown
# # An Jingmin, Sogdian vice commissioner of the Guiyi Army
# # Worked together with Zhang Yichao early on
# RICE_an_001 = {
#   name = "景旻" 	# Jingmin
#   dynasty = RICE_an
#   religion = "mahayana"
#   culture = "sogdian"
#   819.5.13 = { 	#  Unknown
#     birth = yes
#   }
#   # 865.1.1 = {		
#   # 	effect = {
#   # 		set_culture = culture:han
#   # 	}
#   # }
#   879.3.20 = { 	#  Unknown
#     death = yes
#   }
# }
# ###########################################################
# # 
# # KANG FAMILY
# # Lived in Dunhuang for generations, pretty Sinicized
# # Probably mixing together several separate Kang families here
# # 
# ###########################################################
# # Xiuhua - Important lay member of the Sogdian Buddhist community during the Tibetan occupation and merchant who owned the Hufen cosmetic and other luxuries businesses
# # He is only here to connect Tongxin and Shijun and ensure they look Sogdian
# # Actual position of these men in the family is unknown
# # RICE_kang_001 = {
# # 	name="Xiuhua"
# # 	dynasty = RICE_kang
# # 	religion="mahayana"
# # 	culture="sogdian"
# # 	trait=education_stewardship_4
# # 	trait=generous
# # 	trait=zealous
# # 	trait=diligent
# # 	797.12.15={ # Unknown
# # 		birth=yes
# # 	}
# # 	849.6.5={ # Unknown
# # 		death=yes
# # 	}
# # }
# # Tongxin - Magistrate of several towns in the east, unknown relation to rest of family
# RICE_kang_002 = {
#   name = "通信" 	# Tongxin
#   dynasty = RICE_kang
#   religion = "mahayana"
#   culture = "sogdian"
#   #father=RICE_kang_001
#   834.4.28 = { 	#  Unknown
#     birth = yes
#   }
#   # 865.1.1 = {		
#   # 	effect = {
#   # 		set_culture = culture:han
#   # 	}
#   # }
#   881.6.5 = { 	#  actual date?????
#     death = yes
#   }
# }
# # Prefect of Guazhou at one point
# RICE_kang_003 = {
#   name = "世俊" 	# Shijun
#   dynasty = RICE_kang
#   religion = "mahayana"
#   culture = "sogdian"
#   #father=RICE_kang_001
#   827.3.14 = { 	#  Unknown
#     birth = yes
#   }
#   # 865.1.1 = {		
#   # 	effect = {
#   # 		set_culture = culture:han
#   # 	}
#   # }
#   881.7.5 = { 	#  Unknown
#     death = yes
#   }
# }
# # Xianzhao - Monastic official in Dunhuang, unknown relation to rest of family if any, or if he was a secular or clerical official, so I've made him a secular son of Tongxin
# ###########################################################
# # 
# # SONG FAMILY
# # 
# ###########################################################
# # Official who led the Guiyi envoy group to the Tang Dynasty alongside Zhang Wenche in 887 CE
# # Part of the other faction of envoys sent in 887 CE who insisted on staying in Chang'an until they could get the official appointment for Zhang Huaishen
# RICE_song_001 = {
#   name = "润英" 	# Runying
#   dynasty = RICE_song
#   religion = "mahayana"
#   culture = "han"
#   diplomacy = 7 	#  Had to be at least ok at it
#   trait = education_diplomacy_3
#   trait = diligent
#   trait = content
#   trait = patient
#   832.5.28 = { 	# Unknown
#     birth = yes
#   }
#   900.10.30 = { 	# Unknown
#     death = yes
#   }
# }
# # Lady Song, Zhang Yichao's wife, real name unknown
# RICE_song_002 = {
#   name = "婕妤" 	# Jieyu
#   female = yes
#   dynasty = RICE_song
#   religion = "mahayana"
#   culture = "han"
#   800.2.5 = { 	# Unknown
#     birth = yes
#   }
#   817.1.1 = {
#     add_spouse = 206811
#   }
#   881.8.18 = { 	# Unknown
#     death = yes
#   }
# }
# # Lady Song, Cao Yijin's wife, name unknown. I made her Runying's daughter so she's connected and can give Cao Yijin an alliance
# RICE_song_003 = {
#   name = "兰英" 	# Lanying
#   female = yes
#   dynasty = RICE_song
#   religion = "mahayana"
#   culture = "han"
#   father = RICE_song_001
#   850.2.2 = { 	# Unknown
#     birth = yes
#   }
#   866.11.11 = {
#     add_spouse = 1059714
#   }
#   933.3.6 = { 	# Unknown
#     death = yes
#   }
# }
# ###########################################################
# # 
# # WENMO CHARACTERS
# # 
# ###########################################################
# # Zhebu were a major clan of the Wenmo - fictitious leader
# # Zhebu Jiashi is their most important person
# # Became leader in Liangzhou c. 948-949
# RICE_wenmo_001 = {
#   name = "云" 	# Yun
#   dynasty = RICE_zhebu
#   religion = "lamaism"
#   culture = "wenmo"
#   trait = ambitious 	#  Make them sligtly more likely to rebel
#   841.11.17 = { 	#  Unknown
#     birth = yes
#   }
#   899.3.7 = { 	#  actual date?????
#     death = yes
#   }
# }
###########################################################
# 
# MISC CHARACTERS
# 
###########################################################
# Zhu Zaiqing - Alive c. 867 - head of a major Buddhist (lay?) society in Dunhuang
RICE_dunhuang_misc_001 = {
  name = "哉清" 	# Zaiqing
  dynasty = RICE_zhu
  religion = "mahayana"
  culture = "han"
  trait = theologian
  trait = zealous
  trait = diligent
  trait = gregarious
  837.1.2 = { 	# Unknown
    birth = yes
  }
  # 867.1.1 = {
  # 	employer = 244004
  # }
  901.11.16 = { 	# Unknown
    death = yes
  }
}
# Wuzhen - One of the most influential monks of Zhang Yichao's time, important literati, diplomat, and monastic leader
RICE_dunhuang_misc_002 = {
  name = "武震" 	# Wuzhen
  religion = "mahayana"
  culture = "han"
  diplomacy = 7
  martial = 2
  learning = 7
  trait = intellect_good_1
  trait = education_learning_4
  trait = diligent
  trait = zealous
  trait = devoted
  trait = poet
  811.2.19 = { 	#  Known
    birth = yes
  }
  867.1.1 = {
    employer = 244004
  }
  895.4.26 = { 	#  Known
    death = yes
  }
}
# Gao Jinda
# A commander of Zhang Yichao who was sent as his first envoy sent to the Tang court in 850 CE to report news of Dunhuang's "return" to Chinese control
# Apparently the trip was pretty harsh and dangerous
RICE_dunhuang_misc_003 = {
  name = "进达" 	# Jinda
  dynasty = RICE_gao
  religion = "mahayana"
  culture = "han"
  diplomacy = 6
  trait = education_martial_3
  trait = brave
  trait = patient
  trait = diligent
  825.8.25 = { 	# Unknown, but an adult and a commander by 850
    birth = yes
  }
  879.7.4 = { 	# Unknown
    death = yes
  }
}
# Zhang Qiu - also known as Zhang Jingqiu
# Eminent local literati, seems to not be connected to the main Zhang clan, so I've made him from a separate clan. Alive in c. 864
# Wrote a number of manuscripts and steles, including several celebrating the lives and deeds of various prominent figures in Dunhuang.
# This includes some information regarding the chaotic situation post Zhang Yichao.
# He seems to have been quite friendly towards Zhang Huaishen.
RICE_dunhuang_misc_004 = {
  name = "秋" 	# Qiu
  dynasty = RICE_zhang_2
  religion = "mahayana"
  culture = "han"
  trait = intellect_good_1
  trait = education_diplomacy_4
  trait = scholar
  trait = poet
  trait = humble
  trait = patient
  trait = compassionate
  838.2.18 = { 	# Unknown
    birth = yes
  }
  867.1.1 = { 	# employer = 244004
    effect = {
      set_relation_friend = {
        target = character:244004
        reason = RICE_friend_reason_placeholder
      }
    }
  }
  911.12.2 = { 	# Unknown
    death = yes
  }
}
# Yan Yingda
# Prefect of Guazhou
# Was some kind of official under Tibetan occupation, as early as 840
# But also probably played a role in Zhang Yichao's uprising of 848
# RICE_dunhuang_misc_005 = {
#   name = "英达" 	# Yingda
#   dynasty = RICE_yan
#   religion = "mahayana"
#   culture = "han"
#   trait = education_stewardship_3
#   trait = deceitful
#   816.7.9 = { 	# Unknown
#     birth = yes
#   }
#   869.10.12 = { 	# Unknown
#     death = yes
#   }
# }
# Official who led the Guiyi envoy group to the Tang Dynasty alongside Song Runying in 887 CE, and *may* have led the coup against Zhang Huaishen in c. 890
# The main purpose of the trip was to ask the Tang court to formally bestow the title of jiedushi on Zhang Huaishen, Zhang Yichao's successor
# They sent petition after petition to the Emperor but did not receive any response, so the envoy team debated what to do
# One faction led by Zhang Wenche argued that it was pointless to stay, and Zhang even derided Zhang Huaishen as an inept leader
RICE_dunhuang_misc_006 = {
  name = "文彻" 	# Wenche
  dynasty = RICE_zhang_3
  religion = "mahayana"
  culture = "han"
  diplomacy = 7 	#  Had to be at least ok at it
  trait = education_intrigue_3
  trait = ambitious
  trait = deceitful
  trait = impatient
  trait = poet 	#  Wrote poems
  842.6.8 = { 	# Unknown
    birth = yes
  }
  910.3.4 = { 	# Died after 909 when he convinced Zhang Chengfeng to proclaim himself Emperor
    death = yes
  }
}
# Wu Anzheng, one of the envoys sent to the Tang court alongside Li Mingzhen and Wuzhen in the 850s
RICE_dunhuang_misc_007 = {
  name = "安正" 	# Anzheng
  dynasty = RICE_wu
  religion = "mahayana"
  culture = "han"
  trait = education_diplomacy_3
  813.11.14 = { 	#  Unknown
    birth = yes
  }
  # 867.1.1 = { # Couldn't find any info about what other prominent roles he played or if he was even an official, so have him as a courtier for now
  # 	employer = 244004
  # }
  897.10.9 = { 	#  Unknown
    death = yes
  }
}
# Fictitious but plausible Korean in Dunhuang
# Koreans were attested in Dunhuang, including envoys, as discussed in this article: http://idp.bl.uk/archives/news36_37/idpnews_36_37.a4d#5
# Relevant quote:
# "Although Korea is a relative latecomer to this field of study, the international academic community has acknowledged that direct links between Korea, Dunhuang and Central Asia are evident from both the Dunhuang wall paintings as well as the manuscripts. A total of 492 Dunhuang caves has been identified and studied, and Korean envoys wearing feather caps (characteristic of Korean officials in ancient times) are depicted in murals of the Tang period (618–907) including those in caves 220, 237, 332, and 335 (see above). These are certainly of great interest3 as they are evidence that Koreans travelled westward passing through Dunhuang.""
RICE_dunhuang_misc_008 = {
  name = "hyuk_joon"
  dynasty = dynasty_RICE_kim_korean_dunhuang
  religion = "mahayana"
  culture = "silla"
  848.2.5 = { 	#  Fictitious
    birth = yes
    effect = {
      add_character_flag = do_not_generate_starting_family
    }
  }
  939.6.9 = { 	#  Fictitious
    death = yes
  }
}
