# -*- coding: utf-8 -*-
def t600001000_1():
	"""State 0,2"""
	t600001000_x23(val1=9, val2=7)
	Quit()
	"""Unused"""
	"""State 1"""
	t600001000_x11()
	Quit()
	
#main grace menu
def t600001000_x100():
	while True:
		if GetEstusAllocation(EstusType.HP) >= 14: #remove flasks over 14
			EstusAllocationUpdate(14, 0)
			PlayerEquipmentQuantityChange(ItemType.Goods, 1001, -99)
			PlayerEquipmentQuantityChange(ItemType.Goods, 1001, 14)
		else:
			pass
		if GetEventFlag(12000212): #boss rush active
			SetEventFlag(12005434, 1) #player is using grace menu
			ClearTalkListData()
			ClearPreviousMenuSelection()
			#level up
			AddTalkListDataIf(GetPlayerStat(PlayerStat.RuneLevel) <= GetMaxRuneLevel(), 1, 6232098, -1)
			#merchant
			AddTalkListData(2, 6232502, -1)
			#upgrade weapon (standard)
			AddTalkListData(3, 6232048, -1)
			#upgrade weapon (legendary)
			AddTalkListData(4, 6232549, -1)
			#proceed to next round
			AddTalkListData(5, 6232500, -1)
			#return to roundtable
			AddTalkListData(6, 6232501, -1)
			#current target
			if GetEventFlag(12000433): #hidden
				AddTalkListData(7, 6232544, -1)
			else:
				AddTalkListDataIf(GetEventFlag(12000401), 7, 6232529, -1)
				AddTalkListDataIf(GetEventFlag(12000402), 7, 6232530, -1)
				AddTalkListDataIf(GetEventFlag(12000403), 7, 6232531, -1)
				AddTalkListDataIf(GetEventFlag(12000404), 7, 6232532, -1)
				AddTalkListDataIf(GetEventFlag(12000405), 7, 6232533, -1)
				AddTalkListDataIf(GetEventFlag(12000406), 7, 6232534, -1)
				AddTalkListDataIf(GetEventFlag(12000407), 7, 6232535, -1)
				AddTalkListDataIf(GetEventFlag(12000408), 7, 6232536, -1)
				AddTalkListDataIf(GetEventFlag(12000409), 7, 6232537, -1)
				AddTalkListDataIf(GetEventFlag(12000410), 7, 6232538, -1)
				AddTalkListDataIf(GetEventFlag(12000411), 7, 6232539, -1)
				AddTalkListDataIf(GetEventFlag(12000412), 7, 6232540, -1)
				AddTalkListDataIf(GetEventFlag(12000413), 7, 6232541, -1)
				AddTalkListDataIf(GetEventFlag(12000414), 7, 6232542, -1)
				AddTalkListDataIf(GetEventFlag(12000415), 7, 6232543, -1)
			#leave
			AddTalkListData(99, 20000009, -1)
			ShowShopMessage(TalkOptionsType.Regular)
			assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
			#level up
			if GetTalkListEntryResult() == 1:
				SetEventFlag(12005435, 1) #player is using level up menu
				SetWorkValue(0, GetLevelUpSoulCost(GetStatus(PlayerStat.RuneLevel), GetStatus(PlayerStat.RuneLevel) + 1))
				SetMessageTagValue(0, GetWorkValue(0))
				OpenSoul()
				assert not (CheckSpecificPersonMenuIsOpen(10, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
				SetEventFlag(12005435, 0) #player has left level up menu
			#merchant
			elif GetTalkListEntryResult() == 2:
				OpenRegularShop(1000, 1376)
				assert not (CheckSpecificPersonMenuIsOpen(5, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
			#upgrade weapon (regular)
			elif GetTalkListEntryResult() == 3:
				OpenEnhanceShop(EnhanceType.UnlimitedRange)
				assert not (CheckSpecificPersonMenuIsOpen(9, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
			#upgrade weapon (legendary)
			elif GetTalkListEntryResult() == 4:
				OpenLegendaryEnhanceShop()
				assert not (CheckSpecificPersonMenuIsOpen(44, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
			#proceed to next round
			elif GetTalkListEntryResult() == 5:
				SetEventFlag(12000213, 0) #reset boss defeated flag
				SetEventFlag(12005430, 1)
			#return to roundtable
			elif GetTalkListEntryResult() == 6:
				SetEventFlag(12005431, 1)
			#current target
			elif GetTalkListEntryResult() == 7:
				pass
			else:
				SetEventFlag(12005434, 0) #player has left grace menu
				return 0
		else: #single boss mode
			ClearTalkListData()
			ClearPreviousMenuSelection()
			#single boss selection
			AddTalkListDataIf(not GetEventFlag(12000212), 1, 6232000, -1)
			#re-select last boss fought
			AddTalkListDataIf(not GetEventFlag(12000212) and GetEventFlag(12000200), 2, 6232004, -1)
			#expedition boss rush
			#AddTalkListDataIf(not GetEventFlag(12000212), 10, 6232503, -1)
			#resume boss rush in progress
			#AddTalkListDataIf(GetEventFlag(12000212), 11, 6232545, -1)
			#cancel boss rush in progress
			#AddTalkListDataIf(GetEventFlag(12000212), 12, 6232546, -1)
			#equipment
			AddTalkListDataIf(not GetEventFlag(12000212), 4, 6232085, -1)
			#relic rites
			AddTalkListDataIf(not GetEventFlag(12000212), 6, 6232555, -1)
			#apply buffs
			AddTalkListDataIf(not GetEventFlag(12000212), 5, 6232086, -1)
			#options
			AddTalkListData(7, 6232049, -1)
			#cheats
			AddTalkListDataIf(not GetEventFlag(12000212), 3, 6232043, -1)
			#return to roundtable
			AddTalkListData(8, 6232556, -1)
			#leave
			AddTalkListData(99, 20000009, -1)
			ShowShopMessage(TalkOptionsType.Regular)
			assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
			#single boss selection
			if GetTalkListEntryResult() == 1:
				assert t600001000_x900()
			#re-select last boss fought
			elif GetTalkListEntryResult() == 2:
				SetEventFlag(12005200, 1)
			#expedition boss rush
			elif GetTalkListEntryResult() == 10:
				assert t600001000_x950()
			#resume boss rush
			elif GetTalkListEntryResult() == 11:
				SetEventFlag(12005433, 1)
			#cancel boss rush
			elif GetTalkListEntryResult() == 12:
				OpenGenericDialog(8, 6232547, 3, 4, 2)
				assert not CheckSpecificPersonGenericDialogIsOpen(0)
				if GetGenericDialogButtonResult() == 1:
					SetEventFlag(12000212, 0) #reset boss rush active flag
				else:
					pass
			#equipment
			elif GetTalkListEntryResult() == 4:
				assert t600001000_x920()
			#relic rites
			elif GetTalkListEntryResult() == 6:
				OpenRelicMenu()
				assert not (CheckSpecificPersonMenuIsOpen(37, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
			#apply buffs
			elif GetTalkListEntryResult() == 5:
				assert t600001000_x940()
			#options
			elif GetTalkListEntryResult() == 7:
				assert t600001000_x931()
			#cheats
			elif GetTalkListEntryResult() == 3:
				assert t600001000_x930()
			#return to roundtable
			elif GetTalkListEntryResult() == 8:
				SetEventFlag(12005219, 1)
			else:
				return 0

#single boss selection
def t600001000_x900():
	while True:
		ClearTalkListData()
		ClearPreviousMenuSelection()
		#nightlords
		AddTalkListData(1, 6232001, -1)
		#major bosses
		AddTalkListData(3, 6232002, -1)
		#minor bosses
		AddTalkListData(4, 6232003, -1)
		#go back
		AddTalkListData(99, 6232999, -1)
		ShowShopMessage(TalkOptionsType.Regular)
		assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#nightlords
		if GetTalkListEntryResult() == 1:
			assert t600001000_x901()
		#major bosses
		elif GetTalkListEntryResult() == 3:
			assert t600001000_x903()
		#minor bosses
		elif GetTalkListEntryResult() == 4:
			assert t600001000_x904()
		else:
			return 0
		
#nightlords
def t600001000_x901():
	while True:
		ClearTalkListData()
		ClearPreviousMenuSelection()
		#Gladius, Beast of Night
		AddTalkListData(1, 6232250, -1)
		#Adel, Baron of Night
		AddTalkListData(2, 6232251, -1)
		#Gnoster, Wisdom of Night
		AddTalkListData(3, 6232252, -1)
		#Maris, Fathom of Night
		AddTalkListData(4, 6232253, -1)
		#Libra, Creature of Night
		AddTalkListData(5, 6232254, -1)
		#Fulghor, Champion of Nightglow
		AddTalkListData(6, 6232255, -1)
		#Caligo, Miasma of Night
		AddTalkListData(7, 6232256, -1)
		#Heolstor, the Nightlord
		AddTalkListData(8, 6232257, -1)
		#Gladius, Beast of Night (Everdark)
		AddTalkListData(9, 6232260, -1)
		#Adel, Baron of Night (Everdark)
		AddTalkListData(10, 6232261, -1)
		#Gnoster, Wisdom of Night (Everdark)
		AddTalkListData(11, 6232262, -1)
		#Maris, Fathom of Night (Everdark)
		AddTalkListData(12, 6232263, -1)
		#Libra, Creature of Night (Everdark)
		AddTalkListData(13, 6232264, -1)
		#Fulghor, Champion of Nightglow (Everdark)
		AddTalkListData(14, 6232265, -1)
		#Caligo, Miasma of Night (Everdark)
		AddTalkListData(15, 6232266, -1)
		#go back
		AddTalkListData(99, 6232999, -1)
		ShowShopMessage(TalkOptionsType.Regular)
		assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#Gladius, Beast of Night
		if GetTalkListEntryResult() == 1:
			assert t600001000_x911(12005150, 12001000, 12001001, 12001002, 12001003, 12001004, 12001005)
		#Adel, Baron of Night
		elif GetTalkListEntryResult() == 2:
			assert t600001000_x911(12005151, 12001006, 12001007, 12001008, 12001009, 12001010, 12001011)
		#Gnoster, Wisdom of Night
		elif GetTalkListEntryResult() == 3:
			assert t600001000_x911(12005152, 12001012, 12001013, 12001014, 12001015, 12001016, 12001017)
		#Maris, Fathom of Night
		elif GetTalkListEntryResult() == 4:
			assert t600001000_x911(12005153, 12001018, 12001019, 12001020, 12001021, 12001022, 12001023)
		#Libra, Creature of Night
		elif GetTalkListEntryResult() == 5:
			assert t600001000_x911(12005154, 12001024, 12001025, 12001026, 12001027, 12001028, 12001029)
		#Fulghor, Champion of Nightglow
		elif GetTalkListEntryResult() == 6:
			assert t600001000_x911(12005155, 12001030, 12001031, 12001032, 12001033, 12001034, 12001035)
		#Caligo, Miasma of Night
		elif GetTalkListEntryResult() == 7:
			assert t600001000_x911(12005156, 12001036, 12001037, 12001038, 12001039, 12001040, 12001041)
		#Heolstor, the Nightlord
		elif GetTalkListEntryResult() == 8:
			assert t600001000_x911(12005157, 12001042, 12001043, 12001044, 12001045, 12001046, 12001047)
		#Gladius, Beast of Night (Everdark)
		elif GetTalkListEntryResult() == 9:
			assert t600001000_x911(12005160, 12001048, 12001049, 12001050, 12001051, 12001052, 12001053)
		#Adel, Baron of Night (Everdark)
		elif GetTalkListEntryResult() == 10:
			assert t600001000_x911(12005161, 12001054, 12001055, 12001056, 12001057, 12001058, 12001059)
		#Gnoster, Wisdom of Night (Everdark)
		elif GetTalkListEntryResult() == 11:
			assert t600001000_x911(12005162, 12001060, 12001061, 12001062, 12001063, 12001064, 12001065)
		#Maris, Fathom of Night (Everdark)
		elif GetTalkListEntryResult() == 12:
			assert t600001000_x911(12005163, 12001066, 12001067, 12001068, 12001069, 12001070, 12001071)
		#Libra, Creature of Night (Everdark)
		elif GetTalkListEntryResult() == 13:
			assert t600001000_x911(12005164, 12001072, 12001073, 12001074, 12001075, 12001076, 12001077)
		#Fulghor, Champion of Nightglow (Everdark)
		elif GetTalkListEntryResult() == 14:
			assert t600001000_x911(12005165, 12001078, 12001079, 12001080, 12001081, 12001082, 12001083)
		#Caligo, Miasma of Night (Everdark)
		elif GetTalkListEntryResult() == 15:
			assert t600001000_x911(12005166, 12001084, 12001085, 12001086, 12001087, 12001088, 12001089)
		else:
			return 0
	
#major bosses
def t600001000_x903():
	while True:
		ClearTalkListData()
		ClearPreviousMenuSelection()
		#Ancient Dragon
		AddTalkListData(1, 6232179, -1)
		#Battlefield Commander
		AddTalkListData(2, 6232171, -1)
		#Bell Bearing Hunter
		AddTalkListData(3, 6232164, -1)
		#Centipede Demon
		AddTalkListData(4, 6232172, -1)
		#Crucible Knight & Golden Hippopotamus
		AddTalkListData(5, 6232180, -1)
		#Dancer of the Boreal Valley
		AddTalkListData(6, 6232189, -1)
		#Death Rite Bird
		AddTalkListData(7, 6232187, -1)
		#Demi-Human Queen & Demi-Human Swordmaster
		AddTalkListData(8, 6232163, -1)
		#Draconic Tree Sentinel & Royal Cavalrymen
		AddTalkListData(9, 6232184, -1)
		#Fell Omen
		AddTalkListData(10, 6232177, -1)
		#Full-Grown Fallingstar Beast
		AddTalkListData(11, 6232185, -1)
		#Gaping Dragon
		AddTalkListData(12, 6232165, -1)
		#Godskin Duo
		AddTalkListData(13, 6232186, -1)
		#Grafted Monarch
		AddTalkListData(14, 6232175, -1)
		#Great Wyrm
		AddTalkListData(15, 6232182, -1)
		#Nameless King
		AddTalkListData(16, 6232188, -1)
		#Night's Cavalry Duo
		AddTalkListData(17, 6232169, -1)
		#Nox Dragonkin Soldier
		AddTalkListData(18, 6232183, -1)
		#Outland Commander
		AddTalkListData(19, 6232181, -1)
		#Royal Revenant
		AddTalkListData(20, 6232176, -1)
		#Smelter Demon
		AddTalkListData(21, 6232170, -1)
		#The Duke's Dear Freja
		AddTalkListData(22, 6232168, -1)
		#Tibia Mariner
		#AddTalkListData(23, 6232173, -1)
		#Tree Sentinel & Royal Cavalrymen
		AddTalkListData(24, 6232178, -1)
		#Ulcerated Tree Spirit
		AddTalkListData(25, 6232174, -1)
		#Valiant Gargoyle
		AddTalkListData(26, 6232167, -1)
		#Wormface (Night)
		AddTalkListData(27, 6232166, -1)
		#go back
		AddTalkListData(99, 6232999, -1)
		ShowShopMessage(TalkOptionsType.Regular)
		assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#Ancient Dragon
		if GetTalkListEntryResult() == 1:
			assert t600001000_x912(12005079, 12001934, 12001935, 12001879, -1, 12001880, -1, -1, -1, -1, -1, -1, 12001090, 12001091, 12001092, 12001093, 12001094, 12001095, 12001629)
		#Battlefield Commander
		elif GetTalkListEntryResult() == 2:
			assert t600001000_x912(12005071, 12001719, 12001720, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001096, 12001097, 12001098, 12001099, 12001100, 12001101, 12001630)
		#Bell Bearing Hunter
		elif GetTalkListEntryResult() == 3:
			assert t600001000_x912(12005064, 12001721, 12001722, 12001881, 12001882, -1, -1, 12001883, 12001884, -1, -1, -1, 12001102, 12001103, 12001104, 12001105, 12001106, 12001107, 12001631)
		#Centipede Demon
		elif GetTalkListEntryResult() == 4:
			assert t600001000_x912(12005072, 12001723, 12001724, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001108, 12001109, 12001110, 12001111, 12001112, 12001113, 12001632)
		#Crucible Knight & Golden Hippopotamus
		elif GetTalkListEntryResult() == 5:
			assert t600001000_x912(12005080, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001114, 12001115, 12001116, 12001117, 12001118, 12001119, 12001633)
		#Dancer of the Boreal Valley
		elif GetTalkListEntryResult() == 6:
			assert t600001000_x912(12005089, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001120, 12001121, 12001122, 12001123, 12001124, 12001125, 12001634)
		#Death Rite Bird
		elif GetTalkListEntryResult() == 7:
			assert t600001000_x912(12005087, 12001725, 12001726, 12001885, 12001886, 12001887, -1, -1, 12001888, -1, -1, -1, 12001126, 12001127, 12001128, 12001129, 12001130, 12001131, 12001635)
		#Demi-Human Queen & Demi-Human Swordmaster
		elif GetTalkListEntryResult() == 8:
			assert t600001000_x912(12005063, 12001727, 12001728, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001132, 12001133, 12001134, 12001135, 12001136, 12001137, 12001636)
		#Draconic Tree Sentinel & Royal Cavalrymen
		elif GetTalkListEntryResult() == 9:
			assert t600001000_x912(12005084, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001138, 12001139, 12001140, 12001141, 12001142, 12001143, 12001637)
		#Fell Omen
		elif GetTalkListEntryResult() == 10:
			assert t600001000_x912(12005077, 12001729, 12001730, 12001889, -1, -1, -1, -1, -1, -1, -1, 12001890, 12001144, 12001145, 12001146, 12001147, 12001148, 12001149, 12001638)
		#Full-Grown Fallingstar Beast
		elif GetTalkListEntryResult() == 11:
			assert t600001000_x912(12005085, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001150, 12001151, 12001152, 12001153, 12001154, 12001155, 12001639)
		#Gaping Dragon
		elif GetTalkListEntryResult() == 12:
			assert t600001000_x912(12005065, 12001731, 12001732, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001156, 12001157, 12001158, 12001159, 12001160, 12001161, 12001640)
		#Godskin Duo
		elif GetTalkListEntryResult() == 13:
			assert t600001000_x912(12005086, 12001733, 12001734, 12001891, -1, 12001892, -1, -1, -1, -1, -1, -1, 12001162, 12001163, 12001164, 12001165, 12001166, 12001167, 12001641)
		#Grafted Monarch
		elif GetTalkListEntryResult() == 14:
			assert t600001000_x912(12005075, 12001735, 12001736, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001168, 12001169, 12001170, 12001171, 12001172, 12001173, 12001642)
		#Great Wyrm
		elif GetTalkListEntryResult() == 15:
			assert t600001000_x912(12005082, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001174, 12001175, 12001176, 12001177, 12001178, 12001179, 12001643)
		#Nameless King
		elif GetTalkListEntryResult() == 16:
			assert t600001000_x912(12005088, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001180, 12001181, 12001182, 12001183, 12001184, 12001185, 12001644)
		#Night's Cavalry Duo
		elif GetTalkListEntryResult() == 17:
			assert t600001000_x912(12005069, 12001737, 12001738, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001186, 12001187, 12001188, 12001189, 12001190, 12001191, 12001645)
		#Nox Dragonkin Soldier
		elif GetTalkListEntryResult() == 18:
			assert t600001000_x912(12005083, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001192, 12001193, 12001194, 12001195, 12001196, 12001197, 12001646)
		#Outland Commander
		elif GetTalkListEntryResult() == 19:
			assert t600001000_x912(12005081, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001198, 12001199, 12001200, 12001201, 12001202, 12001203, 12001647)
		#Royal Revenant
		elif GetTalkListEntryResult() == 20:
			assert t600001000_x912(12005076, 12001739, 12001740, 12001893, 12001894, -1, -1, 12001895, -1, 12001896, -1, -1, 12001204, 12001205, 12001206, 12001207, 12001208, 12001209, 12001648)
		#Smelter Demon
		elif GetTalkListEntryResult() == 21:
			assert t600001000_x912(12005070, 12001741, 12001742, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001210, 12001211, 12001212, 12001213, 12001214, 12001215, 12001649)
		#The Duke's Dear Freja
		elif GetTalkListEntryResult() == 22:
			assert t600001000_x912(12005068, 12001743, 12001744, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001216, 12001217, 12001218, 12001219, 12001220, 12001221, 12001650)
		#Tibia Mariner
		elif GetTalkListEntryResult() == 23:
			assert t600001000_x912(12005073, 12001745, 12001746, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001222, 12001223, 12001224, 12001225, 12001226, 12001227, 12001651)
		#Tree Sentinel & Royal Cavalrymen
		elif GetTalkListEntryResult() == 24:
			assert t600001000_x912(12005078, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001228, 12001229, 12001230, 12001231, 12001232, 12001233, 12001652)
		#Ulcerated Tree Spirit
		elif GetTalkListEntryResult() == 25:
			assert t600001000_x912(12005074, 12001747, 12001748, 12001897, 12001898, -1, -1, -1, 12001899, -1, -1, -1, 12001234, 12001235, 12001236, 12001237, 12001238, 12001239, 12001653)
		#Valiant Gargoyle
		elif GetTalkListEntryResult() == 26:
			assert t600001000_x912(12005067, 12001749, 12001750, 12001900, -1, -1, -1, -1, -1, -1, 12001901, -1, 12001240, 12001241, 12001242, 12001243, 12001244, 12001245, 12001654)
		#Wormface (Night)
		elif GetTalkListEntryResult() == 27:
			assert t600001000_x912(12005066, 12001751, 12001752, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001246, 12001247, 12001248, 12001249, 12001250, 12001251, 12001655)
		else:
			return 0

#minor bosses
def t600001000_x904():
	while True:
		ClearTalkListData()
		ClearPreviousMenuSelection()
		#Abductor Virgin
		AddTalkListData(1, 6232136, -1)
		#Albinauric Archers
		AddTalkListData(2, 6232141, -1)
		#Albinaurics
		AddTalkListData(3, 6232139, -1)
		#Ancestor Spirit
		AddTalkListData(4, 6232125, -1)
		#Ancient Hero of Zamor
		AddTalkListData(5, 6232116, -1)
		#Ancient Heroes of Zamor
		AddTalkListData(6, 6232147, -1)
		#Banished Knights
		AddTalkListData(7, 6232108, -1)
		#Battlemages
		AddTalkListData(8, 6232138, -1)
		#Beastly Brigade
		AddTalkListData(9, 6232105, -1)
		#Beastmen of Farum Azula (Evergaol)
		AddTalkListData(10, 6232106, -1)
		#Beastmen of Farum Azula (Ruins)
		AddTalkListData(11, 6232142, -1)
		#Black Blade Kindred
		AddTalkListData(12, 6232129, -1)
		#Black Knife Assassin
		AddTalkListData(13, 6232114, -1)
		#Bloodhound Knight
		AddTalkListData(14, 6232102, -1)
		#Crucible Knight (Sword)
		AddTalkListData(15, 6232112, -1)
		#Crucible Knight (Treespear)
		AddTalkListData(16, 6232111, -1)
		#Crystalian Alliance (Evergaol)
		AddTalkListData(17, 6232107, -1)
		#Crystalian Alliance (Fort)
		AddTalkListData(18, 6232143, -1)
		#Demi-Human Queen
		AddTalkListData(19, 6232120, -1)
		#Demi-Human Swordmaster
		AddTalkListData(20, 6232158, -1)
		#Draconic Tree Sentinel
		AddTalkListData(21, 6232130, -1)
		#Dragonkin Soldier
		AddTalkListData(22, 6232144, -1)
		#Elder Lion
		AddTalkListData(23, 6232118, -1)
		#Erdtree Avatar
		AddTalkListData(24, 6232124, -1)
		#Erdtree Burial Watchdogs
		AddTalkListData(25, 6232137, -1)
		#Fallingstar Beast
		AddTalkListData(26, 6232156, -1)
		#Fire Monk
		AddTalkListData(27, 6232133, -1)
		#Fire Prelates
		AddTalkListData(28, 6232155, -1)
		#Flame Chariots
		AddTalkListData(29, 6232152, -1)
		#Flying Dragon
		AddTalkListData(30, 6232146, -1)
		#Flying Dragon of the Hills
		AddTalkListData(31, 6232123, -1)
		#Frenzied Flame Troll
		AddTalkListData(32, 6232154, -1)
		#Giant Crows
		AddTalkListData(33, 6232159, -1)
		#Godskin Apostle
		AddTalkListData(34, 6232110, -1)
		#Godskin Noble
		AddTalkListData(35, 6232109, -1)
		#Golden Hippopotamus
		AddTalkListData(36, 6232119, -1)
		#Grafted Scion
		AddTalkListData(37, 6232113, -1)
		#Grave Warden Duelist
		AddTalkListData(38, 6232101, -1)
		#Guardian Golem (Greatbow)
		AddTalkListData(39, 6232148, -1)
		#Guardian Golem (Halberd)
		AddTalkListData(40, 6232131, -1)
		#Headless Troll
		AddTalkListData(41, 6232161, -1)
		#Leonine Misbegotten
		AddTalkListData(42, 6232117, -1)
		#Lordsworn Captain
		AddTalkListData(43, 6232135, -1)
		#Magma Wyrm
		AddTalkListData(44, 6232127, -1)
		#Mausoleum Knight
		AddTalkListData(45, 6232132, -1)
		#Miranda Blossom
		AddTalkListData(46, 6232121, -1)
		#Mountaintop Ice Dragon
		AddTalkListData(47, 6232160, -1)
		#Naturalborn of the Void
		AddTalkListData(48, 6232162, -1)
		#Night's Cavalry
		AddTalkListData(49, 6232122, -1)
		#Nox Warriors
		AddTalkListData(50, 6232104, -1)
		#Omen
		AddTalkListData(51, 6232100, -1)
		#Oracle Envoys
		AddTalkListData(52, 6232134, -1)
		#Perfumers
		AddTalkListData(53, 6232149, -1)
		#Red Wolf of the King Consort
		AddTalkListData(54, 6232115, -1)
		#Redmane Knights
		AddTalkListData(55, 6232151, -1)
		#Royal Army Knights
		AddTalkListData(56, 6232153, -1)
		#Royal Carian Knight
		AddTalkListData(57, 6232128, -1)
		#Runebear
		AddTalkListData(58, 6232150, -1)
		#Sanguine Noble
		AddTalkListData(59, 6232140, -1)
		#Snowfield Trolls
		AddTalkListData(60, 6232157, -1)
		#Stoneskin Lords
		AddTalkListData(61, 6232103, -1)
		#Tree Sentinel
		AddTalkListData(62, 6232126, -1)
		#Wormface (Ruins)
		AddTalkListData(63, 6232145, -1)
		#go back
		AddTalkListData(99, 6232999, -1)
		ShowShopMessage(TalkOptionsType.Regular)
		assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#Abductor Virgin
		if GetTalkListEntryResult() == 1:
			assert t600001000_x912(12005036, 12001753, 12001754, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001938, 12001252, 12001253, 12001254, 12001255, 12001256, 12001656)
		#Albinauric Archers
		elif GetTalkListEntryResult() == 2:
			assert t600001000_x912(12005041, 12001755, 12001756, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001257, 12001258, 12001259, 12001260, 12001261, 12001262, 12001657)
		#Albinaurics
		elif GetTalkListEntryResult() == 3:
			assert t600001000_x912(12005039, 12001757, 12001758, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001263, 12001264, 12001265, 12001266, 12001267, 12001268, 12001658)
		#Ancestor Spirit
		elif GetTalkListEntryResult() == 4:
			assert t600001000_x912(12005025, 12001759, 12001760, -1, 12001902, -1, -1, -1, 12001903, -1, -1, -1, 12001269, 12001270, 12001271, 12001272, 12001273, 12001274, 12001659)
		#Ancient Hero of Zamor
		elif GetTalkListEntryResult() == 5:
			assert t600001000_x912(12005016, 12001761, 12001762, -1, 12001904, -1, -1, 12001905, -1, -1, -1, -1, 12001275, 12001276, 12001277, 12001278, 12001279, 12001280, 12001660)
		#Ancient Heroes of Zamor
		elif GetTalkListEntryResult() == 6:
			assert t600001000_x912(12005047, 12001763, 12001764, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001281, 12001282, 12001283, 12001284, 12001285, 12001286, 12001661)
		#Banished Knights
		elif GetTalkListEntryResult() == 7:
			assert t600001000_x912(12005008, 12001765, 12001766, -1, -1, 12001906, 12001907, -1, -1, -1, -1, -1, 12001287, 12001288, 12001289, 12001290, 12001291, 12001292, 12001662)
		#Battlemages
		elif GetTalkListEntryResult() == 8:
			assert t600001000_x912(12005038, 12001767, 12001768, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001293, 12001294, 12001295, 12001296, 12001297, 12001298, 12001663)
		#Beastly Brigade
		elif GetTalkListEntryResult() == 9:
			assert t600001000_x912(12005005, 12001769, 12001770, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001299, 12001300, 12001301, 12001302, 12001303, 12001304, 12001664)
		#Beastmen of Farum Azula (Evergaol)
		elif GetTalkListEntryResult() == 10:
			assert t600001000_x912(12005006, 12001771, 12001772, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001305, 12001306, 12001307, 12001308, 12001309, 12001310, 12001665)
		#Beastmen of Farum Azula (Ruins)
		elif GetTalkListEntryResult() == 11:
			assert t600001000_x912(12005042, 12001773, 12001774, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001311, 12001312, 12001313, 12001314, 12001315, 12001316, 12001666)
		#Black Blade Kindred
		elif GetTalkListEntryResult() == 12:
			assert t600001000_x912(12005029, 12001775, 12001776, -1, 12001908, -1, -1, -1, 12001909, -1, -1, -1, 12001317, 12001318, 12001319, 12001320, 12001321, 12001322, 12001667)
		#Black Knife Assassin
		elif GetTalkListEntryResult() == 13:
			assert t600001000_x912(12005014, 12001777, 12001778, -1, 12001910, -1, -1, 12001911, -1, 12001912, -1, -1, 12001323, 12001324, 12001325, 12001326, 12001327, 12001328, 12001668)
		#Bloodhound Knight
		elif GetTalkListEntryResult() == 14:
			assert t600001000_x912(12005002, 12001779, 12001780, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001329, 12001330, 12001331, 12001332, 12001333, 12001334, 12001669)
		#Crucible Knight (Sword)
		elif GetTalkListEntryResult() == 15:
			assert t600001000_x912(12005012, 12001781, 12001782, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001335, 12001336, 12001337, 12001338, 12001339, 12001340, 12001670)
		#Crucible Knight (Treespear)
		elif GetTalkListEntryResult() == 16:
			assert t600001000_x912(12005011, 12001783, 12001784, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001341, 12001342, 12001343, 12001344, 12001345, 12001346, 12001671)
		#Crystalian Alliance (Evergaol)
		elif GetTalkListEntryResult() == 17:
			assert t600001000_x912(12005007, 12001785, 12001786, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001347, 12001348, 12001349, 12001350, 12001351, 12001352, 12001672)
		#Crystalian Alliance (Fort)
		elif GetTalkListEntryResult() == 18:
			assert t600001000_x912(12005043, 12001787, 12001788, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001353, 12001354, 12001355, 12001356, 12001357, 12001358, 12001673)
		#Demi-Human Queen
		elif GetTalkListEntryResult() == 19:
			assert t600001000_x912(12005020, 12001789, 12001790, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001359, 12001360, 12001361, 12001362, 12001363, 12001364, 12001674)
		#Demi-Human Swordmaster
		elif GetTalkListEntryResult() == 20:
			assert t600001000_x912(12005058, 12001791, 12001792, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001365, 12001366, 12001367, 12001368, 12001369, 12001370, 12001675)
		#Draconic Tree Sentinel
		elif GetTalkListEntryResult() == 21:
			assert t600001000_x912(12005030, 12001793, 12001794, -1, 12001913, -1, -1, -1, 12001914, -1, -1, -1, 12001371, 12001372, 12001373, 12001374, 12001375, 12001376, 12001676)
		#Dragonkin Soldier
		elif GetTalkListEntryResult() == 22:
			assert t600001000_x912(12005044, 12001795, 12001796, -1, -1, 12001936, -1, -1, -1, 12001937, -1, -1, 12001377, 12001378, 12001379, 12001380, 12001381, 12001382, 12001677)
		#Elder Lion
		elif GetTalkListEntryResult() == 23:
			assert t600001000_x912(12005018, 12001797, 12001798, -1, 12001915, -1, 12001916, -1, -1, -1, -1, -1, 12001383, 12001384, 12001385, 12001386, 12001387, 12001388, 12001678)
		#Erdtree Avatar
		elif GetTalkListEntryResult() == 24:
			assert t600001000_x912(12005024, 12001799, 12001800, -1, 12001917, -1, -1, -1, 12001918, -1, -1, -1, 12001389, 12001390, 12001391, 12001392, 12001393, 12001394, 12001679)
		#Erdtree Burial Watchdogs
		elif GetTalkListEntryResult() == 25:
			assert t600001000_x912(12005037, 12001801, 12001802, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001395, 12001396, 12001397, 12001398, 12001399, 12001400, 12001680)
		#Fallingstar Beast
		elif GetTalkListEntryResult() == 26:
			assert t600001000_x912(12005056, 12001803, 12001804, -1, -1, -1, -1, -1, -1, -1, 12001919, 12001920, 12001401, 12001402, 12001403, 12001404, 12001405, 12001406, 12001681)
		#Fire Monk
		elif GetTalkListEntryResult() == 27:
			assert t600001000_x912(12005033, 12001805, 12001806, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001407, 12001408, 12001409, 12001410, 12001411, 12001412, 12001682)
		#Fire Prelates
		elif GetTalkListEntryResult() == 28:
			assert t600001000_x912(12005055, 12001807, 12001808, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001413, 12001414, 12001415, 12001416, 12001417, 12001418, 12001683)
		#Flame Chariots
		elif GetTalkListEntryResult() == 29:
			assert t600001000_x912(12005052, 12001809, 12001810, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001419, 12001420, 12001421, 12001422, 12001423, 12001424, 12001684)
		#Flying Dragon
		elif GetTalkListEntryResult() == 30:
			assert t600001000_x912(12005046, 12001811, 12001812, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001425, 12001426, 12001427, 12001428, 12001429, 12001430, 12001685)
		#Flying Dragon of the Hills
		elif GetTalkListEntryResult() == 31:
			assert t600001000_x912(12005023, 12001813, 12001814, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001431, 12001432, 12001433, 12001434, 12001435, 12001436, 12001686)
		#Frenzied Flame Troll
		elif GetTalkListEntryResult() == 32:
			assert t600001000_x912(12005054, 12001815, 12001816, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001437, 12001438, 12001439, 12001440, 12001441, 12001442, 12001687)
		#Giant Crows
		elif GetTalkListEntryResult() == 33:
			assert t600001000_x912(12005059, 12001817, 12001818, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001443, 12001444, 12001445, 12001446, 12001447, 12001448, 12001688)
		#Godskin Apostle
		elif GetTalkListEntryResult() == 34:
			assert t600001000_x912(12005010, 12001819, 12001820, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001449, 12001450, 12001451, 12001452, 12001453, 12001454, 12001689)
		#Godskin Noble
		elif GetTalkListEntryResult() == 35:
			assert t600001000_x912(12005009, 12001821, 12001822, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001455, 12001456, 12001457, 12001458, 12001459, 12001460, 12001690)
		#Golden Hippopotamus
		elif GetTalkListEntryResult() == 36:
			assert t600001000_x912(12005019, 12001823, 12001824, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001461, 12001462, 12001463, 12001464, 12001465, 12001466, 12001691)
		#Grafted Scion
		elif GetTalkListEntryResult() == 37:
			assert t600001000_x912(12005013, 12001825, 12001826, -1, 12001921, -1, -1, 12001922, -1, -1, -1, -1, 12001467, 12001468, 12001469, 12001470, 12001471, 12001472, 12001692)
		#Grave Warden Duelist
		elif GetTalkListEntryResult() == 38:
			assert t600001000_x912(12005001, 12001827, 12001828, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001473, 12001474, 12001475, 12001476, 12001477, 12001478, 12001693)
		#Guardian Golem (Greatbow)
		elif GetTalkListEntryResult() == 39:
			assert t600001000_x912(12005048, 12001829, 12001830, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001479, 12001480, 12001481, 12001482, 12001483, 12001484, 12001694)
		#Guardian Golem (Halberd)
		elif GetTalkListEntryResult() == 40:
			assert t600001000_x912(12005031, 12001831, 12001832, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001485, 12001486, 12001487, 12001488, 12001489, 12001490, 12001695)
		#Headless Troll
		elif GetTalkListEntryResult() == 41:
			assert t600001000_x912(12005061, 12001833, 12001834, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001491, 12001492, 12001493, 12001494, 12001495, 12001496, 12001696)
		#Leonine Misbegotten
		elif GetTalkListEntryResult() == 42:
			assert t600001000_x912(12005017, 12001835, 12001836, -1, 12001923, -1, 12001924, 12001925, -1, -1, -1, -1, 12001497, 12001498, 12001499, 12001500, 12001501, 12001502, 12001697)
		#Lordsworn Captain
		elif GetTalkListEntryResult() == 43:
			assert t600001000_x912(12005035, 12001837, 12001838, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001503, 12001504, 12001505, 12001506, 12001507, 12001508, 12001698)
		#Magma Wyrm
		elif GetTalkListEntryResult() == 44:
			assert t600001000_x912(12005027, 12001839, 12001840, -1, 12001926, -1, -1, -1, 12001927, -1, -1, -1, 12001509, 12001510, 12001511, 12001512, 12001513, 12001514, 12001699)
		#Mausoleum Knight
		elif GetTalkListEntryResult() == 45:
			assert t600001000_x912(12005032, 12001841, 12001842, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001515, 12001516, 12001517, 12001518, 12001519, 12001520, 12001700)
		#Miranda Blossom
		elif GetTalkListEntryResult() == 46:
			assert t600001000_x912(12005021, 12001843, 12001844, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001521, 12001522, 12001523, 12001524, 12001525, 12001526, 12001701)
		#Mountaintop Ice Dragon
		elif GetTalkListEntryResult() == 47:
			assert t600001000_x912(12005060, 12001845, 12001846, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001527, 12001528, 12001529, 12001530, 12001531, 12001532, 12001702)
		#Naturalborn of the Void
		elif GetTalkListEntryResult() == 48:
			assert t600001000_x912(12005062, 12001847, 12001848, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001533, 12001534, 12001535, 12001536, 12001537, 12001538, 12001703)
		#Night's Cavalry
		elif GetTalkListEntryResult() == 49:
			assert t600001000_x912(12005022, 12001849, 12001850, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001539, 12001540, 12001541, 12001542, 12001543, 12001544, 12001704)
		#Nox Warriors
		elif GetTalkListEntryResult() == 50:
			assert t600001000_x912(12005004, 12001851, 12001852, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001545, 12001546, 12001547, 12001548, 12001549, 12001550, 12001705)
		#Omen
		elif GetTalkListEntryResult() == 51:
			assert t600001000_x912(12005000, 12001853, 12001854, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001551, 12001552, 12001553, 12001554, 12001555, 12001556, 12001706)
		#Oracle Envoys
		elif GetTalkListEntryResult() == 52:
			assert t600001000_x912(12005034, 12001855, 12001856, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001557, 12001558, 12001559, 12001560, 12001561, 12001562, 12001707)
		#Perfumers
		elif GetTalkListEntryResult() == 53:
			assert t600001000_x912(12005049, 12001857, 12001858, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001563, 12001564, 12001565, 12001566, 12001567, 12001568, 12001708)
		#Red Wolf of the King Consort
		elif GetTalkListEntryResult() == 54:
			assert t600001000_x912(12005015, 12001859, 12001860, -1, 12001928, -1, -1, 12001929, -1, -1, -1, -1, 12001569, 12001570, 12001571, 12001572, 12001573, 12001574, 12001709)
		#Redmane Knights
		elif GetTalkListEntryResult() == 55:
			assert t600001000_x912(12005051, 12001861, 12001862, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001575, 12001576, 12001577, 12001578, 12001579, 12001580, 12001710)
		#Royal Army Knights
		elif GetTalkListEntryResult() == 56:
			assert t600001000_x912(12005053, 12001863, 12001864, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001581, 12001582, 12001583, 12001584, 12001585, 12001586, 12001711)
		#Royal Carian Knight
		elif GetTalkListEntryResult() == 57:
			assert t600001000_x912(12005028, 12001865, 12001866, -1, 12001930, -1, -1, -1, 12001931, -1, -1, -1, 12001587, 12001588, 12001589, 12001590, 12001591, 12001592, 12001712)
		#Runebear
		elif GetTalkListEntryResult() == 58:
			assert t600001000_x912(12005050, 12001867, 12001868, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001593, 12001594, 12001595, 12001596, 12001597, 12001598, 12001713)
		#Sanguine Noble
		elif GetTalkListEntryResult() == 59:
			assert t600001000_x912(12005040, 12001869, 12001870, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001599, 12001600, 12001601, 12001602, 12001603, 12001604, 12001714)
		#Snowfield Trolls
		elif GetTalkListEntryResult() == 60:
			assert t600001000_x912(12005057, 12001871, 12001872, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001605, 12001606, 12001607, 12001608, 12001609, 12001610, 12001715)
		#Stoneskin Lords
		elif GetTalkListEntryResult() == 61:
			assert t600001000_x912(12005003, 12001873, 12001874, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001611, 12001612, 12001613, 12001614, 12001615, 12001616, 12001716)
		#Tree Sentinel
		elif GetTalkListEntryResult() == 62:
			assert t600001000_x912(12005026, 12001875, 12001876, -1, 12001932, -1, -1, -1, 12001933, -1, -1, -1, 12001617, 12001618, 12001619, 12001620, 12001621, 12001622, 12001717)
		#Wormface (Ruins)
		elif GetTalkListEntryResult() == 63:
			assert t600001000_x912(12005045, 12001877, 12001878, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12001623, 12001624, 12001625, 12001626, 12001627, 12001628, 12001718)
		else:
			return 0

#boss variant options (nightlords)
def t600001000_x911(trigger, depth0, depth1, depth2, depth3, depth4, depth5):
	while True:
		ClearTalkListData()
		ClearPreviousMenuSelection()
		#begin battle
		AddTalkListData(1, 6232005, -1)
		#scaling/variants
		#AddTalkListData(2, 6232006, -1)
		#depth 0
		AddTalkListDataIf(not GetEventFlag(depth0), 3, 6232029, -1) #off
		AddTalkListDataIf(GetEventFlag(depth0), 3, 6232030, -1) #on
		#depth 1
		AddTalkListDataIf(not GetEventFlag(depth1), 4, 6232031, -1) #off
		AddTalkListDataIf(GetEventFlag(depth1), 4, 6232032, -1) #on
		#depth 2
		AddTalkListDataIf(not GetEventFlag(depth2), 5, 6232033, -1) #off
		AddTalkListDataIf(GetEventFlag(depth2), 5, 6232034, -1) #on
		#depth 3
		AddTalkListDataIf(not GetEventFlag(depth3), 6, 6232035, -1) #off
		AddTalkListDataIf(GetEventFlag(depth3), 6, 6232036, -1) #on
		#depth 4
		AddTalkListDataIf(not GetEventFlag(depth4), 7, 6232037, -1) #off
		AddTalkListDataIf(GetEventFlag(depth4), 7, 6232038, -1) #on
		#depth 5
		AddTalkListDataIf(not GetEventFlag(depth5), 8, 6232039, -1) #off
		AddTalkListDataIf(GetEventFlag(depth5), 8, 6232040, -1) #on
		#go back
		AddTalkListData(99, 6232999, -1)
		ShowShopMessage(TalkOptionsType.Regular)
		assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#begin battle
		if GetTalkListEntryResult() == 1:
			SetEventFlag(trigger, 1)
		#scaling/variants
		elif GetTalkListEntryResult() == 2:
			pass
		#depth 0
		elif GetTalkListEntryResult() == 3:
			SetEventFlag(depth0, 1)
			SetEventFlag(depth1, 0)
			SetEventFlag(depth2, 0)
			SetEventFlag(depth3, 0)
			SetEventFlag(depth4, 0)
			SetEventFlag(depth5, 0)
		#depth 1
		elif GetTalkListEntryResult() == 4:
			SetEventFlag(depth0, 0)
			SetEventFlag(depth1, 1)
			SetEventFlag(depth2, 0)
			SetEventFlag(depth3, 0)
			SetEventFlag(depth4, 0)
			SetEventFlag(depth5, 0)
		#depth 2
		elif GetTalkListEntryResult() == 5:
			SetEventFlag(depth0, 0)
			SetEventFlag(depth1, 0)
			SetEventFlag(depth2, 1)
			SetEventFlag(depth3, 0)
			SetEventFlag(depth4, 0)
			SetEventFlag(depth5, 0)
		#depth 3
		elif GetTalkListEntryResult() == 6:
			SetEventFlag(depth0, 0)
			SetEventFlag(depth1, 0)
			SetEventFlag(depth2, 0)
			SetEventFlag(depth3, 1)
			SetEventFlag(depth4, 0)
			SetEventFlag(depth5, 0)
		#depth 4
		elif GetTalkListEntryResult() == 7:
			SetEventFlag(depth0, 0)
			SetEventFlag(depth1, 0)
			SetEventFlag(depth2, 0)
			SetEventFlag(depth3, 0)
			SetEventFlag(depth4, 1)
			SetEventFlag(depth5, 0)
		#depth 5
		elif GetTalkListEntryResult() == 8:
			SetEventFlag(depth0, 0)
			SetEventFlag(depth1, 0)
			SetEventFlag(depth2, 0)
			SetEventFlag(depth3, 0)
			SetEventFlag(depth4, 0)
			SetEventFlag(depth5, 1)
		else:
			return 0

#boss variant options (other bosses)
def t600001000_x912(trigger, day1, day2, night, field, gaol, camp, basement, rooftop, noklateo, crater, event, depth0, depth1, depth2, depth3, depth4, depth5, mutation):
	while True:
		ClearTalkListData()
		ClearPreviousMenuSelection()
		#begin battle
		AddTalkListData(1, 6232005, -1)
		#scaling/variants
		#AddTalkListData(2, 6232006, -1)
		if trigger == 12005079 or trigger == 12005087 or trigger == 12005086: #special cases where day1/2 scaling only applies to evergaol variant
			#day 1 scaling
			AddTalkListDataIf(day1 != -1 and not GetEventFlag(day1) and not GetEventFlag(night), 9, 6232007, -1) #off
			AddTalkListDataIf(day1 != -1 and GetEventFlag(day1) and not GetEventFlag(night), 9, 6232008, -1) #on
			#day 2 scaling
			AddTalkListDataIf(day2 != -1 and not GetEventFlag(day2) and not GetEventFlag(night), 10, 6232009, -1) #off
			AddTalkListDataIf(day2 != -1 and GetEventFlag(day2) and not GetEventFlag(night), 10, 6232010, -1) #on
		else:
			#day 1 scaling
			AddTalkListDataIf(day1 != -1 and not GetEventFlag(day1), 9, 6232007, -1) #off
			AddTalkListDataIf(day1 != -1 and GetEventFlag(day1), 9, 6232008, -1) #on
			#day 2 scaling
			AddTalkListDataIf(day2 != -1 and not GetEventFlag(day2), 10, 6232009, -1) #off
			AddTalkListDataIf(day2 != -1 and GetEventFlag(day2), 10, 6232010, -1) #on
		#night
		AddTalkListDataIf(night != -1 and not GetEventFlag(night), 11, 6232011, -1) #off
		AddTalkListDataIf(night != -1 and GetEventFlag(night), 11, 6232012, -1) #on
		#field
		AddTalkListDataIf(field != -1 and not GetEventFlag(field), 12, 6232013, -1) #off
		AddTalkListDataIf(field != -1 and GetEventFlag(field), 12, 6232014, -1) #on
		#evergaol
		AddTalkListDataIf(gaol != -1 and not GetEventFlag(gaol), 13, 6232015, -1) #off
		AddTalkListDataIf(gaol != -1 and GetEventFlag(gaol), 13, 6232016, -1) #on
		#camp
		AddTalkListDataIf(camp != -1 and not GetEventFlag(camp), 14, 6232017, -1) #off
		AddTalkListDataIf(camp != -1 and GetEventFlag(camp), 14, 6232018, -1) #on
		#basement
		AddTalkListDataIf(basement != -1 and not GetEventFlag(basement), 15, 6232019, -1) #off
		AddTalkListDataIf(basement != -1 and GetEventFlag(basement), 15, 6232020, -1) #on
		#rooftop
		AddTalkListDataIf(rooftop != -1 and not GetEventFlag(rooftop), 16, 6232021, -1) #off
		AddTalkListDataIf(rooftop != -1 and GetEventFlag(rooftop), 16, 6232022, -1) #on
		#noklateo
		AddTalkListDataIf(noklateo != -1 and not GetEventFlag(noklateo), 17, 6232023, -1) #off
		AddTalkListDataIf(noklateo != -1 and GetEventFlag(noklateo), 17, 6232024, -1) #on
		#crater
		AddTalkListDataIf(crater != -1 and not GetEventFlag(crater), 18, 6232025, -1) #off
		AddTalkListDataIf(crater != -1 and GetEventFlag(crater), 18, 6232026, -1) #on
		#event
		AddTalkListDataIf(event != -1 and not GetEventFlag(event), 19, 6232027, -1) #off
		AddTalkListDataIf(event != -1 and GetEventFlag(event), 19, 6232028, -1) #on
		#depth 0
		AddTalkListDataIf(not GetEventFlag(depth0), 3, 6232029, -1) #off
		AddTalkListDataIf(GetEventFlag(depth0), 3, 6232030, -1) #on
		#depth 1
		AddTalkListDataIf(not GetEventFlag(depth1), 4, 6232031, -1) #off
		AddTalkListDataIf(GetEventFlag(depth1), 4, 6232032, -1) #on
		#depth 2
		AddTalkListDataIf(not GetEventFlag(depth2), 5, 6232033, -1) #off
		AddTalkListDataIf(GetEventFlag(depth2), 5, 6232034, -1) #on
		#depth 3
		AddTalkListDataIf(not GetEventFlag(depth3), 6, 6232035, -1) #off
		AddTalkListDataIf(GetEventFlag(depth3), 6, 6232036, -1) #on
		#depth 4
		AddTalkListDataIf(not GetEventFlag(depth4), 7, 6232037, -1) #off
		AddTalkListDataIf(GetEventFlag(depth4), 7, 6232038, -1) #on
		#depth 5
		AddTalkListDataIf(not GetEventFlag(depth5), 8, 6232039, -1) #off
		AddTalkListDataIf(GetEventFlag(depth5), 8, 6232040, -1) #on
		#mutation
		AddTalkListDataIf(mutation != -1 and not GetEventFlag(mutation), 20, 6232042, -1) #off
		AddTalkListDataIf(mutation != -1 and GetEventFlag(mutation), 21, 6232041, -1) #on
		#go back
		AddTalkListData(99, 6232999, -1)
		ShowShopMessage(TalkOptionsType.Regular)
		assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#begin battle
		if GetTalkListEntryResult() == 1:
			SetEventFlag(trigger, 1)
		#scaling/variants
		elif GetTalkListEntryResult() == 2:
			pass
		#day 1 scaling
		elif GetTalkListEntryResult() == 9:
			SetEventFlag(day1, 1)
			SetEventFlag(day2, 0)
		#day 2 scaling
		elif GetTalkListEntryResult() == 10:
			SetEventFlag(day1, 0)
			SetEventFlag(day2, 1)
		#night
		elif GetTalkListEntryResult() == 11:
			SetEventFlag(night, 1)
			SetEventFlag(field, 0)
			SetEventFlag(gaol, 0)
			SetEventFlag(camp, 0)
			SetEventFlag(basement, 0)
			SetEventFlag(rooftop, 0)
			SetEventFlag(noklateo, 0)
			SetEventFlag(crater, 0)
			SetEventFlag(event, 0)
		#field
		elif GetTalkListEntryResult() == 12:
			SetEventFlag(night, 0)
			SetEventFlag(field, 1)
			SetEventFlag(gaol, 0)
			SetEventFlag(camp, 0)
			SetEventFlag(basement, 0)
			SetEventFlag(rooftop, 0)
			SetEventFlag(noklateo, 0)
			SetEventFlag(crater, 0)
			SetEventFlag(event, 0)
		#evergaol
		elif GetTalkListEntryResult() == 13:
			SetEventFlag(night, 0)
			SetEventFlag(field, 0)
			SetEventFlag(gaol, 1)
			SetEventFlag(camp, 0)
			SetEventFlag(basement, 0)
			SetEventFlag(rooftop, 0)
			SetEventFlag(noklateo, 0)
			SetEventFlag(crater, 0)
			SetEventFlag(event, 0)
		#camp
		elif GetTalkListEntryResult() == 14:
			SetEventFlag(night, 0)
			SetEventFlag(field, 0)
			SetEventFlag(gaol, 0)
			SetEventFlag(camp, 1)
			SetEventFlag(basement, 0)
			SetEventFlag(rooftop, 0)
			SetEventFlag(noklateo, 0)
			SetEventFlag(crater, 0)
			SetEventFlag(event, 0)
		#basement
		elif GetTalkListEntryResult() == 15:
			SetEventFlag(night, 0)
			SetEventFlag(field, 0)
			SetEventFlag(gaol, 0)
			SetEventFlag(camp, 0)
			SetEventFlag(basement, 1)
			SetEventFlag(rooftop, 0)
			SetEventFlag(noklateo, 0)
			SetEventFlag(crater, 0)
			SetEventFlag(event, 0)
		#rooftop
		elif GetTalkListEntryResult() == 16:
			SetEventFlag(night, 0)
			SetEventFlag(field, 0)
			SetEventFlag(gaol, 0)
			SetEventFlag(camp, 0)
			SetEventFlag(basement, 0)
			SetEventFlag(rooftop, 1)
			SetEventFlag(noklateo, 0)
			SetEventFlag(crater, 0)
			SetEventFlag(event, 0)
		#noklateo
		elif GetTalkListEntryResult() == 17:
			SetEventFlag(night, 0)
			SetEventFlag(field, 0)
			SetEventFlag(gaol, 0)
			SetEventFlag(camp, 0)
			SetEventFlag(basement, 0)
			SetEventFlag(rooftop, 0)
			SetEventFlag(noklateo, 1)
			SetEventFlag(crater, 0)
			SetEventFlag(event, 0)
		#crater
		elif GetTalkListEntryResult() == 18:
			SetEventFlag(night, 0)
			SetEventFlag(field, 0)
			SetEventFlag(gaol, 0)
			SetEventFlag(camp, 0)
			SetEventFlag(basement, 0)
			SetEventFlag(rooftop, 0)
			SetEventFlag(noklateo, 0)
			SetEventFlag(crater, 1)
			SetEventFlag(event, 0)
		#event
		elif GetTalkListEntryResult() == 19:
			SetEventFlag(night, 0)
			SetEventFlag(field, 0)
			SetEventFlag(gaol, 0)
			SetEventFlag(camp, 0)
			SetEventFlag(basement, 0)
			SetEventFlag(rooftop, 0)
			SetEventFlag(noklateo, 0)
			SetEventFlag(crater, 0)
			SetEventFlag(event, 1)
		#depth 0
		elif GetTalkListEntryResult() == 3:
			SetEventFlag(depth0, 1)
			SetEventFlag(depth1, 0)
			SetEventFlag(depth2, 0)
			SetEventFlag(depth3, 0)
			SetEventFlag(depth4, 0)
			SetEventFlag(depth5, 0)
		#depth 1
		elif GetTalkListEntryResult() == 4:
			SetEventFlag(depth0, 0)
			SetEventFlag(depth1, 1)
			SetEventFlag(depth2, 0)
			SetEventFlag(depth3, 0)
			SetEventFlag(depth4, 0)
			SetEventFlag(depth5, 0)
		#depth 2
		elif GetTalkListEntryResult() == 5:
			SetEventFlag(depth0, 0)
			SetEventFlag(depth1, 0)
			SetEventFlag(depth2, 1)
			SetEventFlag(depth3, 0)
			SetEventFlag(depth4, 0)
			SetEventFlag(depth5, 0)
		#depth 3
		elif GetTalkListEntryResult() == 6:
			SetEventFlag(depth0, 0)
			SetEventFlag(depth1, 0)
			SetEventFlag(depth2, 0)
			SetEventFlag(depth3, 1)
			SetEventFlag(depth4, 0)
			SetEventFlag(depth5, 0)
		#depth 4
		elif GetTalkListEntryResult() == 7:
			SetEventFlag(depth0, 0)
			SetEventFlag(depth1, 0)
			SetEventFlag(depth2, 0)
			SetEventFlag(depth3, 0)
			SetEventFlag(depth4, 1)
			SetEventFlag(depth5, 0)
		#depth 5
		elif GetTalkListEntryResult() == 8:
			SetEventFlag(depth0, 0)
			SetEventFlag(depth1, 0)
			SetEventFlag(depth2, 0)
			SetEventFlag(depth3, 0)
			SetEventFlag(depth4, 0)
			SetEventFlag(depth5, 1)
		#mutation
		elif GetTalkListEntryResult() == 20:
			SetEventFlag(mutation, 1)
		elif GetTalkListEntryResult() == 21:
			SetEventFlag(mutation, 0)
		else:
			return 0
			
#expedition boss rush
def t600001000_x950():
	while True:
		ClearTalkListData()
		ClearPreviousMenuSelection()
		#Target: Random
		AddTalkListData(50, 6232519, -1)
		#Target: Tricephalos
		AddTalkListData(1, 6232504, -1)
		#Target: Gaping Jaw
		AddTalkListData(2, 6232505, -1)
		#Target: Sentient Pest
		AddTalkListData(3, 6232506, -1)
		#Target: Augur
		AddTalkListData(4, 6232507, -1)
		#Target: Equilibrious Beast
		AddTalkListData(5, 6232508, -1)
		#Target: Darkdrift Knight
		AddTalkListData(6, 6232509, -1)
		#Target: Fissure in the Fog
		AddTalkListData(7, 6232510, -1)
		#Target: Night Aspect
		AddTalkListData(8, 6232511, -1)
		#Target: Tricephalos (Everdark)
		AddTalkListData(9, 6232512, -1)
		#Target: Gaping Jaw (Everdark)
		AddTalkListData(10, 6232513, -1)
		#Target: Sentient Pest (Everdark)
		AddTalkListData(11, 6232514, -1)
		#Target: Augur (Everdark)
		AddTalkListData(12, 6232515, -1)
		#Target: Equilibrious Beast (Everdark)
		AddTalkListData(13, 6232516, -1)
		#Target: Darkdrift Knight (Everdark)
		AddTalkListData(14, 6232517, -1)
		#Target: Fissure in the Fog (Everdark)
		AddTalkListData(15, 6232518, -1)
		#go back
		AddTalkListData(99, 6232999, -1)
		ShowShopMessage(TalkOptionsType.Regular)
		assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#Target: Random
		if GetTalkListEntryResult() == 50:
			assert t600001000_x951(12005400)
		#Target: Tricephalos
		elif GetTalkListEntryResult() == 1:
			assert t600001000_x951(12005401)
		#Target: Gaping Jaw
		elif GetTalkListEntryResult() == 2:
			assert t600001000_x951(12005402)
		#Target: Sentient Pest
		elif GetTalkListEntryResult() == 3:
			assert t600001000_x951(12005403)
		#Target: Augur
		elif GetTalkListEntryResult() == 4:
			assert t600001000_x951(12005404)
		#Target: Equilibrious Beast
		elif GetTalkListEntryResult() == 5:
			assert t600001000_x951(12005405)
		#Target: Darkdrift Knight
		elif GetTalkListEntryResult() == 6:
			assert t600001000_x951(12005406)
		#Target: Fissure in the Fog
		elif GetTalkListEntryResult() == 7:
			assert t600001000_x951(12005407)
		#Target: Night Aspect
		elif GetTalkListEntryResult() == 8:
			assert t600001000_x951(12005408)
		#Target: Tricephalos (Everdark)
		elif GetTalkListEntryResult() == 9:
			assert t600001000_x951(12005409)
		#Target: Gaping Jaw (Everdark)
		elif GetTalkListEntryResult() == 10:
			assert t600001000_x951(12005410)
		#Target: Sentient Pest (Everdark)
		elif GetTalkListEntryResult() == 11:
			assert t600001000_x951(12005411)
		#Target: Augur (Everdark)
		elif GetTalkListEntryResult() == 12:
			assert t600001000_x951(12005412)
		#Target: Equilibrious Beast (Everdark)
		elif GetTalkListEntryResult() == 13:
			assert t600001000_x951(12005413)
		#Target: Darkdrift Knight (Everdark)
		elif GetTalkListEntryResult() == 14:
			assert t600001000_x951(12005414)
		#Target: Fissure in the Fog (Everdark)
		elif GetTalkListEntryResult() == 15:
			assert t600001000_x951(12005415)
		else:
			return 0
			
#expedition boss rush options
def t600001000_x951(trigger):
	while True:
		ClearTalkListData()
		ClearPreviousMenuSelection()
		#begin boss rush
		AddTalkListData(1, 6232526, -1)
		#regular only
		AddTalkListDataIf(trigger == 12005400 and GetEventFlag(12000430), 2, 6232523, -1) #on
		AddTalkListDataIf(trigger == 12005400 and not GetEventFlag(12000430), 2, 6232520, -1) #off
		#everdark only
		AddTalkListDataIf(trigger == 12005400 and GetEventFlag(12000431), 3, 6232524, -1) #on
		AddTalkListDataIf(trigger == 12005400 and not GetEventFlag(12000431), 3, 6232521, -1) #off
		#regular + everdark
		AddTalkListDataIf(trigger == 12005400 and GetEventFlag(12000432), 4, 6232525, -1) #on
		AddTalkListDataIf(trigger == 12005400 and not GetEventFlag(12000432), 4, 6232522, -1) #off
		#hidden
		AddTalkListDataIf(trigger == 12005400 and GetEventFlag(12000433), 5, 6232527, -1) #on
		AddTalkListDataIf(trigger == 12005400 and not GetEventFlag(12000433), 6, 6232528, -1) #off
		#depth 0
		AddTalkListDataIf(not GetEventFlag(12000434), 7, 6232029, -1) #off
		AddTalkListDataIf(GetEventFlag(12000434), 7, 6232030, -1) #on
		#depth 1
		AddTalkListDataIf(not GetEventFlag(12000435), 8, 6232031, -1) #off
		AddTalkListDataIf(GetEventFlag(12000435), 8, 6232032, -1) #on
		#depth 2
		AddTalkListDataIf(not GetEventFlag(12000436), 9, 6232033, -1) #off
		AddTalkListDataIf(GetEventFlag(12000436), 9, 6232034, -1) #on
		#depth 3
		AddTalkListDataIf(not GetEventFlag(12000437), 10, 6232035, -1) #off
		AddTalkListDataIf(GetEventFlag(12000437), 10, 6232036, -1) #on
		#depth 4
		AddTalkListDataIf(not GetEventFlag(12000438), 11, 6232037, -1) #off
		AddTalkListDataIf(GetEventFlag(12000438), 11, 6232038, -1) #on
		#depth 5
		AddTalkListDataIf(not GetEventFlag(12000439), 12, 6232039, -1) #off
		AddTalkListDataIf(GetEventFlag(12000439), 12, 6232040, -1) #on
		#go back
		AddTalkListData(99, 6232999, -1)
		ShowShopMessage(TalkOptionsType.Regular)
		assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#begin boss rush
		if GetTalkListEntryResult() == 1:
			SetEventFlag(trigger, 1)
		#regular only
		elif GetTalkListEntryResult() == 2:
			SetEventFlag(12000430, 1)
			SetEventFlag(12000431, 0)
			SetEventFlag(12000432, 0)
		#everdark only
		elif GetTalkListEntryResult() == 3:
			SetEventFlag(12000430, 0)
			SetEventFlag(12000431, 1)
			SetEventFlag(12000432, 0)
		#regular + everdark
		elif GetTalkListEntryResult() == 4:
			SetEventFlag(12000430, 0)
			SetEventFlag(12000431, 0)
			SetEventFlag(12000432, 1)
		#hidden
		elif GetTalkListEntryResult() == 5:
			SetEventFlag(12000433, 0)
		elif GetTalkListEntryResult() == 6:
			SetEventFlag(12000433, 1)
		#depth 0
		elif GetTalkListEntryResult() == 7:
			SetEventFlag(12000434, 1)
			SetEventFlag(12000435, 0)
			SetEventFlag(12000436, 0)
			SetEventFlag(12000437, 0)
			SetEventFlag(12000438, 0)
			SetEventFlag(12000439, 0)
		#depth 1
		elif GetTalkListEntryResult() == 8:
			SetEventFlag(12000434, 0)
			SetEventFlag(12000435, 1)
			SetEventFlag(12000436, 0)
			SetEventFlag(12000437, 0)
			SetEventFlag(12000438, 0)
			SetEventFlag(12000439, 0)
		#depth 2
		elif GetTalkListEntryResult() == 9:
			SetEventFlag(12000434, 0)
			SetEventFlag(12000435, 0)
			SetEventFlag(12000436, 1)
			SetEventFlag(12000437, 0)
			SetEventFlag(12000438, 0)
			SetEventFlag(12000439, 0)
		#depth 3
		elif GetTalkListEntryResult() == 10:
			SetEventFlag(12000434, 0)
			SetEventFlag(12000435, 0)
			SetEventFlag(12000436, 0)
			SetEventFlag(12000437, 1)
			SetEventFlag(12000438, 0)
			SetEventFlag(12000439, 0)
		#depth 4
		elif GetTalkListEntryResult() == 11:
			SetEventFlag(12000434, 0)
			SetEventFlag(12000435, 0)
			SetEventFlag(12000436, 0)
			SetEventFlag(12000437, 0)
			SetEventFlag(12000438, 1)
			SetEventFlag(12000439, 0)
		#depth 5
		elif GetTalkListEntryResult() == 12:
			SetEventFlag(12000434, 0)
			SetEventFlag(12000435, 0)
			SetEventFlag(12000436, 0)
			SetEventFlag(12000437, 0)
			SetEventFlag(12000438, 0)
			SetEventFlag(12000439, 1)
		else:
			return 0
			
#equipment
def t600001000_x920():
	while True:
		ClearTalkListData()
		ClearPreviousMenuSelection()
		#sparring equipment
		AddTalkListData(1, 6232046, -1)
		#upgrade weapons (standard)
		AddTalkListData(2, 6232048, -1)
		#upgrade weapons (legendary)
		AddTalkListData(3, 6232047, -1)
		#talismans
		AddTalkListData(4, 6232083, -1)
		#flask options
		AddTalkListData(5, 6232055, -1)
		#small jar bazaar
		AddTalkListData(6, 6232076, -1)
		#collector signboard
		AddTalkListData(7, 6232077, -1)
		#unlock all unique relics
		AddTalkListDataIf(not GetEventFlag(12000210), 8, 6232078, -1)
		AddTalkListDataIf(GetEventFlag(12000210), 9, 6232084, -1)
		#unlock all remembrance relic vessels
		AddTalkListDataIf(not GetEventFlag(12000209), 10, 6232080, -1)
		AddTalkListDataIf(GetEventFlag(12000209), 11, 6232082, -1)
		#unlock all remembrance outfits
		AddTalkListDataIf(not GetEventFlag(12000208), 12, 6232079, -1)
		AddTalkListDataIf(GetEventFlag(12000208), 13, 6232081, -1)
		#go back
		AddTalkListData(99, 6232999, -1)
		ShowShopMessage(TalkOptionsType.Regular)
		assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#sparring equipment
		if GetTalkListEntryResult() == 1:
			OpenSparringEquipmentMenu()
			assert not (CheckSpecificPersonMenuIsOpen(40, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#upgrade weapons (standard)
		elif GetTalkListEntryResult() == 2:
			OpenEnhanceShop(EnhanceType.UnlimitedRange)
			assert not (CheckSpecificPersonMenuIsOpen(9, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#upgrade weapons (legendary)
		elif GetTalkListEntryResult() == 3:
			OpenLegendaryEnhanceShop()
			assert not (CheckSpecificPersonMenuIsOpen(44, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#talismans
		elif GetTalkListEntryResult() == 4:
			OpenRegularShop(33000, 33099)
			assert not (CheckSpecificPersonMenuIsOpen(-1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#flask options
		elif GetTalkListEntryResult() == 5:
			assert t600001000_x921()
		#small jar bazaar
		elif GetTalkListEntryResult() == 6:
			OpenJarShop(10000, 10197)
			assert not (CheckSpecificPersonMenuIsOpen(38, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#collector signboard
		elif GetTalkListEntryResult() == 7:
			OpenCatalogShop(13000, 13271)
			assert not (CheckSpecificPersonMenuIsOpen(47, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#unlock all unique relics
		elif GetTalkListEntryResult() == 8:
			SetEventFlag(12005210, 1)
			SetEventFlag(12000210, 1)
		elif GetTalkListEntryResult() == 9:
			pass
		#unlock all remembrance relic vessels
		elif GetTalkListEntryResult() == 10:
			SetEventFlag(12005209, 1)
			SetEventFlag(12000209, 1)
		elif GetTalkListEntryResult() == 11:
			pass
		#unlock all remembrance outfits
		elif GetTalkListEntryResult() == 12:
			SetEventFlag(12005208, 1)
			SetEventFlag(12000208, 1)
		elif GetTalkListEntryResult() == 13:
			pass
		else:
			return 0
			
#flask options
def t600001000_x921():
	while True:
		ClearTalkListData()
		ClearPreviousMenuSelection()
		#add charge to flask
		AddTalkListData(1, 6232056, -1)
		#max out flask charges
		AddTalkListData(2, 6232059, -1)
		#reset flask charges
		AddTalkListData(3, 6232057, -1)
		#current charges
		AddTalkListDataIf(GetEstusAllocation(EstusType.HP) == 0, 4, 6232060, -1)
		AddTalkListDataIf(GetEstusAllocation(EstusType.HP) == 1, 4, 6232061, -1)
		AddTalkListDataIf(GetEstusAllocation(EstusType.HP) == 2, 4, 6232062, -1)
		AddTalkListDataIf(GetEstusAllocation(EstusType.HP) == 3, 4, 6232063, -1)
		AddTalkListDataIf(GetEstusAllocation(EstusType.HP) == 4, 4, 6232064, -1)
		AddTalkListDataIf(GetEstusAllocation(EstusType.HP) == 5, 4, 6232065, -1)
		AddTalkListDataIf(GetEstusAllocation(EstusType.HP) == 6, 4, 6232066, -1)
		AddTalkListDataIf(GetEstusAllocation(EstusType.HP) == 7, 4, 6232067, -1)
		AddTalkListDataIf(GetEstusAllocation(EstusType.HP) == 8, 4, 6232068, -1)
		AddTalkListDataIf(GetEstusAllocation(EstusType.HP) == 9, 4, 6232069, -1)
		AddTalkListDataIf(GetEstusAllocation(EstusType.HP) == 10, 4, 6232070, -1)
		AddTalkListDataIf(GetEstusAllocation(EstusType.HP) == 11, 4, 6232071, -1)
		AddTalkListDataIf(GetEstusAllocation(EstusType.HP) == 12, 4, 6232072, -1)
		AddTalkListDataIf(GetEstusAllocation(EstusType.HP) == 13, 4, 6232073, -1)
		AddTalkListDataIf(GetEstusAllocation(EstusType.HP) == 14, 4, 6232074, -1)
		#go back
		AddTalkListData(99, 6232999, -1)
		ShowShopMessage(TalkOptionsType.Regular)
		assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#add charge to flask
		if GetTalkListEntryResult() == 1:
			if GetEstusAllocation(EstusType.HP) == 14:
				SetEventFlag(12005205, 1) #emevd message
			else:
				EstusAllocationUpdate(GetEstusAllocation(EstusType.HP) + 1, 0)
		#max out flask charges
		elif GetTalkListEntryResult() == 2:
			if GetEstusAllocation(EstusType.HP) == 14:
				SetEventFlag(12005205, 1) #emevd message
			else:
				EstusAllocationUpdate(14, 0)
		#reset flask charges
		elif GetTalkListEntryResult() == 3:
			if GetEstusAllocation(EstusType.HP) == 3:
				SetEventFlag(12005206, 1) #emevd message
			else:
				EstusAllocationUpdate(3, 0)
				PlayerEquipmentQuantityChange(ItemType.Goods, 1001, -99)
				PlayerEquipmentQuantityChange(ItemType.Goods, 1001, 3)
		#current charges
		elif GetTalkListEntryResult() == 4:
			pass
		else:
			return 0
		SetEventFlag(12005207, 1) #emevd refill

#buffs menu
def t600001000_x940():
	while True:
		ClearTalkListData()
		ClearPreviousMenuSelection()
		#offensive
		AddTalkListData(1, 6232087, -1)
		#defensive
		AddTalkListData(2, 6232088, -1)
		#multipurpose
		AddTalkListData(3, 6232089, -1)
		#apply all buffs
		AddTalkListData(4, 6232094, -1)
		#clear all buffs
		AddTalkListData(5, 6232090, -1)
		#go back
		AddTalkListData(99, 6232999, -1)
		ShowShopMessage(TalkOptionsType.Regular)
		assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#offensive
		if GetTalkListEntryResult() == 1:
			assert t600001000_x941()
		#defensive
		elif GetTalkListEntryResult() == 2:
			assert t600001000_x942()
		#multipurpose
		elif GetTalkListEntryResult() == 3:
			assert t600001000_x943()
		#apply all buffs
		elif GetTalkListEntryResult() == 4:
			SetEventFlag(12005215, 1)
		#clear all buffs
		elif GetTalkListEntryResult() == 5:
			SetEventFlag(12005211, 1)
		else:
			return 0
			
#offensive buffs
def t600001000_x941():
	while True:
		ClearTalkListData()
		ClearPreviousMenuSelection()
		#apply all
		AddTalkListData(200, 6232095, -1)
		#clear all
		AddTalkListData(201, 6232091, -1)
		#Improved Physical Attack Power (+6%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8100000), 1, 6232300, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8100000), 101, 6232400, -1)
		#Improved Physical Attack Power (+9%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8100001), 2, 6232301, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8100001), 102, 6232401, -1)
		#Improved Affinity Attack Power (+5%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8100500), 3, 6232302, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8100500), 103, 6232402, -1)
		#Improved Affinity Attack Power (+8%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8100501), 4, 6232303, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8100501), 104, 6232403, -1)
		#Improved Stance-Breaking (+10%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8120000), 5, 6232304, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8120000), 105, 6232404, -1)
		#Improved Stance-Breaking (+15%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8120001), 6, 6232305, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8120001), 106, 6232405, -1)
		#Dragonwound upon Dragon Communion
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8330700), 7, 6232306, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8330700), 107, 6232406, -1)
		#Successful Parries Activate Golden Retaliation
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8350400), 8, 6232307, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8350400), 108, 6232407, -1)
		#Lightning upon Dodging
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8410100), 9, 6232308, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8410100), 109, 6232408, -1)
		#Guard Counters Activate Holy Attacks
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8420100), 10, 6232309, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8420100), 110, 6232409, -1)
		#Guard Counters Activate Summoning Attack
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8420200), 11, 6232310, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8420200), 111, 6232410, -1)
		#Improved Thrusting Counterattack (+20%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8430000), 12, 6232311, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8430000), 112, 6232411, -1)
		#Ice Storm Surge Sprint
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8450100), 13, 6232312, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8450100), 113, 6232412, -1)
		#Flame of Frenzy While Walking
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8460200), 14, 6232313, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8460200), 114, 6232413, -1)
		#Violent Deluge of Star Rain While Walking
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8460400), 15, 6232314, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8460400), 115, 6232414, -1)
		#Periodical Giant Glintblades
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8530200), 16, 6232315, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8530200), 116, 6232415, -1)
		#Increased Damage after Critical Hit (+15%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8642000), 17, 6232316, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8642000), 117, 6232416, -1)
		#Critical Hits Inflict Blood Loss
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8660200), 18, 6232317, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8660200), 118, 6232417, -1)
		#Blood Loss in Vicinity Increases Attack Power (+20%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8710002), 19, 6232318, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8710002), 119, 6232418, -1)
		#go back
		AddTalkListData(99, 6232999, -1)
		ShowShopMessage(TalkOptionsType.Regular)
		assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#apply all
		if GetTalkListEntryResult() == 200:
			SetEventFlag(12005216, 1)
		#clear all
		elif GetTalkListEntryResult() == 201:
			SetEventFlag(12005212, 1)
		#Improved Physical Attack Power (+6%)
		elif GetTalkListEntryResult() == 1:
			GiveSpEffectToPlayer(8100000)
			SetEventFlag(12000300, 1)
		elif GetTalkListEntryResult() == 101:
			SetEventFlag(12005300, 1)
			SetEventFlag(12000300, 0)
		#Improved Physical Attack Power (+9%)
		elif GetTalkListEntryResult() == 2:
			GiveSpEffectToPlayer(8100001)
			SetEventFlag(12000301, 1)
		elif GetTalkListEntryResult() == 102:
			SetEventFlag(12005301, 1)
			SetEventFlag(12000301, 0)
		#Improved Affinity Attack Power (+5%)
		elif GetTalkListEntryResult() == 3:
			GiveSpEffectToPlayer(8100500)
			SetEventFlag(12000302, 1)
		elif GetTalkListEntryResult() == 103:
			SetEventFlag(12005302, 1)
			SetEventFlag(12000302, 0)
		#Improved Affinity Attack Power (+8%)
		elif GetTalkListEntryResult() == 4:
			GiveSpEffectToPlayer(8100501)
			SetEventFlag(12000303, 1)
		elif GetTalkListEntryResult() == 104:
			SetEventFlag(12005303, 1)
			SetEventFlag(12000303, 0)
		#Improved Stance-Breaking (+10%)
		elif GetTalkListEntryResult() == 5:
			GiveSpEffectToPlayer(8120000)
			SetEventFlag(12000304, 1)
		elif GetTalkListEntryResult() == 105:
			SetEventFlag(12005304, 1)
			SetEventFlag(12000304, 0)
		#Improved Stance-Breaking (+15%)
		elif GetTalkListEntryResult() == 6:
			GiveSpEffectToPlayer(8120001)
			SetEventFlag(12000305, 1)
		elif GetTalkListEntryResult() == 106:
			SetEventFlag(12005305, 1)
			SetEventFlag(12000305, 0)
		#Dragonwound upon Dragon Communion
		elif GetTalkListEntryResult() == 7:
			GiveSpEffectToPlayer(8330700)
			SetEventFlag(12000306, 1)
		elif GetTalkListEntryResult() == 107:
			SetEventFlag(12005306, 1)
			SetEventFlag(12000306, 0)
		#Successful Parries Activate Golden Retaliation
		elif GetTalkListEntryResult() == 8:
			GiveSpEffectToPlayer(8350400)
			SetEventFlag(12000307, 1)
		elif GetTalkListEntryResult() == 108:
			SetEventFlag(12005307, 1)
			SetEventFlag(12000307, 0)
		#Lightning upon Dodging
		elif GetTalkListEntryResult() == 9:
			GiveSpEffectToPlayer(8410100)
			SetEventFlag(12000308, 1)
		elif GetTalkListEntryResult() == 109:
			SetEventFlag(12005308, 1)
			SetEventFlag(12000308, 0)
		#Guard Counters Activate Holy Attacks
		elif GetTalkListEntryResult() == 10:
			GiveSpEffectToPlayer(8420100)
			SetEventFlag(12000309, 1)
		elif GetTalkListEntryResult() == 110:
			SetEventFlag(12005309, 1)
			SetEventFlag(12000309, 0)
		#Guard Counters Activate Summoning Attack
		elif GetTalkListEntryResult() == 11:
			GiveSpEffectToPlayer(8420200)
			SetEventFlag(12000310, 1)
		elif GetTalkListEntryResult() == 111:
			SetEventFlag(12005310, 1)
			SetEventFlag(12000310, 0)
		#Improved Thrusting Counterattack (+20%)
		elif GetTalkListEntryResult() == 12:
			GiveSpEffectToPlayer(8430000)
			SetEventFlag(12000311, 1)
		elif GetTalkListEntryResult() == 112:
			SetEventFlag(12005311, 1)
			SetEventFlag(12000311, 0)
		#Ice Storm Surge Sprint
		elif GetTalkListEntryResult() == 13:
			GiveSpEffectToPlayer(8450100)
			SetEventFlag(12000312, 1)
		elif GetTalkListEntryResult() == 113:
			SetEventFlag(12005312, 1)
			SetEventFlag(12000312, 0)
		#Flame of Frenzy While Walking
		elif GetTalkListEntryResult() == 14:
			GiveSpEffectToPlayer(8460200)
			SetEventFlag(12000313, 1)
		elif GetTalkListEntryResult() == 114:
			SetEventFlag(12005313, 1)
			SetEventFlag(12000313, 0)
		#Violent Deluge of Star Rain While Walking
		elif GetTalkListEntryResult() == 15:
			GiveSpEffectToPlayer(8460400)
			SetEventFlag(12000314, 1)
		elif GetTalkListEntryResult() == 115:
			SetEventFlag(12005314, 1)
			SetEventFlag(12000314, 0)
		#Periodical Giant Glintblades
		elif GetTalkListEntryResult() == 16:
			GiveSpEffectToPlayer(8530200)
			SetEventFlag(12000315, 1)
		elif GetTalkListEntryResult() == 116:
			SetEventFlag(12005315, 1)
			SetEventFlag(12000315, 0)
		#Increased Damage after Critical Hit (+15%)
		elif GetTalkListEntryResult() == 17:
			GiveSpEffectToPlayer(8642000)
			SetEventFlag(12000316, 1)
		elif GetTalkListEntryResult() == 117:
			SetEventFlag(12005316, 1)
			SetEventFlag(12000316, 0)
		#Critical Hits Inflict Blood Loss
		elif GetTalkListEntryResult() == 18:
			GiveSpEffectToPlayer(8660200)
			SetEventFlag(12000317, 1)
		elif GetTalkListEntryResult() == 118:
			SetEventFlag(12005317, 1)
			SetEventFlag(12000317, 0)
		#Blood Loss in Vicinity Increases Attack Power (+20%)
		elif GetTalkListEntryResult() == 19:
			GiveSpEffectToPlayer(8710002)
			SetEventFlag(12000318, 1)
		elif GetTalkListEntryResult() == 119:
			SetEventFlag(12005318, 1)
			SetEventFlag(12000318, 0)
		else:
			return 0
		assert GetCurrentStateElapsedFrames(2)
			
#defensive buffs
def t600001000_x942():
	while True:
		ClearTalkListData()
		ClearPreviousMenuSelection()
		#apply all
		AddTalkListData(200, 6232096, -1)
		#clear all
		AddTalkListData(201, 6232092, -1)
		#Favor of the Rotted Woods
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(6999200), 1, 6232319, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(6999200), 101, 6232419, -1)
		#Favor of Noklateo, the Shrouded City
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(6999100), 2, 6232320, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(6999100), 102, 6232420, -1)
		#Increased Maximum HP (+10%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8000000), 3, 6232321, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8000000), 103, 6232421, -1)
		#Increased Maximum HP (+15%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8000001), 4, 6232322, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8000001), 104, 6232422, -1)
		#Improved Physical Damage Negation (+12%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8200000), 5, 6232323, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8200000), 105, 6232423, -1)
		#Improved Physical Damage Negation (+18%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8200001), 6, 6232324, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8200001), 106, 6232424, -1)
		#Improved Affinity Damage Negation (+12%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8200500), 7, 6232325, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8200500), 107, 6232425, -1)
		#Improved Affinity Damage Negation (+18%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8200501), 8, 6232326, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8200501), 108, 6232426, -1)
		#All Resistances Up (+57)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8210700), 9, 6232327, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8210700), 109, 6232427, -1)
		#All Resistances Up (+75)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8210701), 10, 6232328, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8210701), 110, 6232428, -1)
		#Improved Poise (+25%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8230000), 11, 6232329, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8230000), 111, 6232429, -1)
		#Improved Poise (+38%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8230001), 12, 6232330, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8230001), 112, 6232430, -1)
		#Improved Dodging
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8410000), 13, 6232331, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8410000), 113, 6232431, -1)
		#Improved Flask HP Restoration (+20%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8440000), 14, 6232332, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8440000), 114, 6232432, -1)
		#Improved Flask HP Restoration (+30%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8440001), 15, 6232333, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8440001), 115, 6232433, -1)
		#Gradual Restoration by Flask
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8440200), 16, 6232334, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8440200), 116, 6232434, -1)
		#HP Restoration upon Successive Attacks (+3%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8610000), 17, 6232335, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8610000), 117, 6232435, -1)
		#Critical Hit HP Restoration (+10%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8640000), 18, 6232336, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8640000), 118, 6232436, -1)
		#HP Recovery From Successful Guarding (+10)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8650000), 19, 6232337, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8650000), 119, 6232437, -1)
		#Poison & Rot Trigger Continuous HP Recovery (+7)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8700002), 20, 6232338, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8700002), 120, 6232438, -1)
		#go back
		AddTalkListData(99, 6232999, -1)
		ShowShopMessage(TalkOptionsType.Regular)
		assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#apply all
		if GetTalkListEntryResult() == 200:
			SetEventFlag(12005217, 1)
		#clear all
		elif GetTalkListEntryResult() == 201:
			SetEventFlag(12005213, 1)
		#Favor of the Rotted Woods
		elif GetTalkListEntryResult() == 1:
			GiveSpEffectToPlayer(6999200)
			SetEventFlag(12000319, 1)
		elif GetTalkListEntryResult() == 101:
			SetEventFlag(12005319, 1)
			SetEventFlag(12000319, 0)
		#Favor of Noklateo, the Shrouded City
		elif GetTalkListEntryResult() == 2:
			GiveSpEffectToPlayer(6999100)
			SetEventFlag(12000320, 1)
		elif GetTalkListEntryResult() == 102:
			SetEventFlag(12005320, 1)
			SetEventFlag(12000320, 0)
		#Increased Maximum HP (+10%)
		elif GetTalkListEntryResult() == 3:
			GiveSpEffectToPlayer(8000000)
			SetEventFlag(12000321, 1)
		elif GetTalkListEntryResult() == 103:
			SetEventFlag(12005321, 1)
			SetEventFlag(12000321, 0)
		#Increased Maximum HP (+15%)
		elif GetTalkListEntryResult() == 4:
			GiveSpEffectToPlayer(8000001)
			SetEventFlag(12000322, 1)
		elif GetTalkListEntryResult() == 104:
			SetEventFlag(12005322, 1)
			SetEventFlag(12000322, 0)
		#Improved Physical Damage Negation (+12%)
		elif GetTalkListEntryResult() == 5:
			GiveSpEffectToPlayer(8200000)
			SetEventFlag(12000323, 1)
		elif GetTalkListEntryResult() == 105:
			SetEventFlag(12005323, 1)
			SetEventFlag(12000323, 0)
		#Improved Physical Damage Negation (+18%)
		elif GetTalkListEntryResult() == 6:
			GiveSpEffectToPlayer(8200001)
			SetEventFlag(12000324, 1)
		elif GetTalkListEntryResult() == 106:
			SetEventFlag(12005324, 1)
			SetEventFlag(12000324, 0)
		#Improved Affinity Damage Negation (+12%)
		elif GetTalkListEntryResult() == 7:
			GiveSpEffectToPlayer(8200500)
			SetEventFlag(12000325, 1)
		elif GetTalkListEntryResult() == 107:
			SetEventFlag(12005325, 1)
			SetEventFlag(12000325, 0)
		#Improved Affinity Damage Negation (+18%)
		elif GetTalkListEntryResult() == 8:
			GiveSpEffectToPlayer(8200501)
			SetEventFlag(12000326, 1)
		elif GetTalkListEntryResult() == 108:
			SetEventFlag(12005326, 1)
			SetEventFlag(12000326, 0)
		#All Resistances Up (+57)
		elif GetTalkListEntryResult() == 9:
			GiveSpEffectToPlayer(8210700)
			SetEventFlag(12000327, 1)
		elif GetTalkListEntryResult() == 109:
			SetEventFlag(12005327, 1)
			SetEventFlag(12000327, 0)
		#All Resistances Up (+75)
		elif GetTalkListEntryResult() == 10:
			GiveSpEffectToPlayer(8210701)
			SetEventFlag(12000328, 1)
		elif GetTalkListEntryResult() == 110:
			SetEventFlag(12005328, 1)
			SetEventFlag(12000328, 0)
		#Improved Poise (+25%)
		elif GetTalkListEntryResult() == 11:
			GiveSpEffectToPlayer(8230000)
			SetEventFlag(12000329, 1)
		elif GetTalkListEntryResult() == 111:
			SetEventFlag(12005329, 1)
			SetEventFlag(12000329, 0)
		#Improved Poise (+38%)
		elif GetTalkListEntryResult() == 12:
			GiveSpEffectToPlayer(8230001)
			SetEventFlag(12000330, 1)
		elif GetTalkListEntryResult() == 112:
			SetEventFlag(12005330, 1)
			SetEventFlag(12000330, 0)
		#Improved Dodging
		elif GetTalkListEntryResult() == 13:
			GiveSpEffectToPlayer(8410000)
			SetEventFlag(12000331, 1)
		elif GetTalkListEntryResult() == 113:
			SetEventFlag(12005331, 1)
			SetEventFlag(12000331, 0)
		#Improved Flask HP Restoration (+20%)
		elif GetTalkListEntryResult() == 14:
			GiveSpEffectToPlayer(8440000)
			SetEventFlag(12000332, 1)
		elif GetTalkListEntryResult() == 114:
			SetEventFlag(12005332, 1)
			SetEventFlag(12000332, 0)
		#Improved Flask HP Restoration (+30%)
		elif GetTalkListEntryResult() == 15:
			GiveSpEffectToPlayer(8440001)
			SetEventFlag(12000333, 1)
		elif GetTalkListEntryResult() == 115:
			SetEventFlag(12005333, 1)
			SetEventFlag(12000333, 0)
		#Gradual Restoration by Flask
		elif GetTalkListEntryResult() == 16:
			GiveSpEffectToPlayer(8440200)
			SetEventFlag(12000334, 1)
		elif GetTalkListEntryResult() == 116:
			SetEventFlag(12005334, 1)
			SetEventFlag(12000334, 0)
		#HP Restoration upon Successive Attacks (+3%)
		elif GetTalkListEntryResult() == 17:
			GiveSpEffectToPlayer(8610000)
			SetEventFlag(12000335, 1)
		elif GetTalkListEntryResult() == 117:
			SetEventFlag(12005335, 1)
			SetEventFlag(12000335, 0)
		#Critical Hit HP Restoration (+10%)
		elif GetTalkListEntryResult() == 18:
			GiveSpEffectToPlayer(8640000)
			SetEventFlag(12000336, 1)
		elif GetTalkListEntryResult() == 118:
			SetEventFlag(12005336, 1)
			SetEventFlag(12000336, 0)
		#HP Recovery From Successful Guarding (+10)
		elif GetTalkListEntryResult() == 19:
			GiveSpEffectToPlayer(8650000)
			SetEventFlag(12000337, 1)
		elif GetTalkListEntryResult() == 119:
			SetEventFlag(12005337, 1)
			SetEventFlag(12000337, 0)
		#Poison & Rot Trigger Continuous HP Recovery (+7)
		elif GetTalkListEntryResult() == 20:
			GiveSpEffectToPlayer(8700002)
			SetEventFlag(12000338, 1)
		elif GetTalkListEntryResult() == 120:
			SetEventFlag(12005338, 1)
			SetEventFlag(12000338, 0)
		else:
			return 0
		assert GetCurrentStateElapsedFrames(2)
			
#multipurpose buffs
def t600001000_x943():
	while True:
		ClearTalkListData()
		ClearPreviousMenuSelection()
		#apply all
		AddTalkListData(200, 6232097, -1)
		#clear all
		AddTalkListData(201, 6232093, -1)
		#Favor of the Night (Improved Art Gauge charge)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(6999000), 1, 6232339, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(6999000), 101, 6232439, -1)
		#Favor of the Mountaintop
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(6999300), 2, 6232340, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(6999300), 102, 6232440, -1)
		#Increased Maximum FP (+10%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8010000), 3, 6232341, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8010000), 103, 6232441, -1)
		#Increased Maximum FP (+15%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8010001), 4, 6232342, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8010001), 104, 6232442, -1)
		#Reduced FP Consumption (+10%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8010100), 5, 6232343, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8010100), 105, 6232443, -1)
		#Reduced FP Consumption (+15%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8010101), 6, 6232344, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8010101), 106, 6232444, -1)
		#Increased Max Stamina (+10%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8020000), 7, 6232345, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8020000), 107, 6232445, -1)
		#Increased Max Stamina (+15%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8020001), 8, 6232346, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8020001), 108, 6232446, -1)
		#Improved Stamina Recovery (+4)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8020200), 9, 6232347, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8020200), 109, 6232447, -1)
		#Improved Stamina Recovery (+6)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8020201), 10, 6232348, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8020201), 110, 6232448, -1)
		#Improved Sorceries and Incantations (+7%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8330103), 11, 6232349, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8330103), 111, 6232449, -1)
		#Improved Sorceries and Incantations (+11%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8330104), 12, 6232350, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8330104), 112, 6232450, -1)
		#Extended Sorcery and Incantation Duration (+100%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8330500), 13, 6232351, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8330500), 113, 6232451, -1)
		#Improved Ultimate Art Gauge Charge Speed (+6%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8360000), 14, 6232352, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8360000), 114, 6232452, -1)
		#Character Skill Cooldown Reduction (+10%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8370000), 15, 6232353, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8370000), 115, 6232453, -1)
		#FP Restoration upon Successive Attacks (+10%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8610100), 16, 6232354, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8610100), 116, 6232454, -1)
		#Critical Hit FP Restoration (+10%)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8640100), 17, 6232355, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8640100), 117, 6232455, -1)
		#FP Recovery From Successful Guarding (+2)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8650100), 18, 6232356, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8650100), 118, 6232456, -1)
		#Creates Holy Ground at Low HP
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8660300), 19, 6232357, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8660300), 119, 6232457, -1)
		#Unifying Fate (Flask also restores FP)
		AddTalkListDataIf(not DoesPlayerHaveSpEffect(8970020), 20, 6232358, -1)
		AddTalkListDataIf(DoesPlayerHaveSpEffect(8970020), 120, 6232458, -1)
		#go back
		AddTalkListData(99, 6232999, -1)
		ShowShopMessage(TalkOptionsType.Regular)
		assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#apply all
		if GetTalkListEntryResult() == 200:
			SetEventFlag(12005218, 1)
		#clear all
		elif GetTalkListEntryResult() == 201:
			SetEventFlag(12005214, 1)
		#Favor of the Night (Improved Art Gauge charge)
		elif GetTalkListEntryResult() == 1:
			GiveSpEffectToPlayer(6999000)
			SetEventFlag(12000339, 1)
		elif GetTalkListEntryResult() == 101:
			SetEventFlag(12005339, 1)
			SetEventFlag(12000339, 0)
		#Favor of the Mountaintop
		elif GetTalkListEntryResult() == 2:
			GiveSpEffectToPlayer(6999300)
			SetEventFlag(12000340, 1)
		elif GetTalkListEntryResult() == 102:
			SetEventFlag(12005340, 1)
			SetEventFlag(12000340, 0)
		#Increased Maximum FP (+10%)
		elif GetTalkListEntryResult() == 3:
			GiveSpEffectToPlayer(8010000)
			SetEventFlag(12000341, 1)
		elif GetTalkListEntryResult() == 103:
			SetEventFlag(12005341, 1)
			SetEventFlag(12000341, 0)
		#Increased Maximum FP (+15%)
		elif GetTalkListEntryResult() == 4:
			GiveSpEffectToPlayer(8010001)
			SetEventFlag(12000342, 1)
		elif GetTalkListEntryResult() == 104:
			SetEventFlag(12005342, 1)
			SetEventFlag(12000342, 0)
		#Reduced FP Consumption (+10%)
		elif GetTalkListEntryResult() == 5:
			GiveSpEffectToPlayer(8010100)
			SetEventFlag(12000343, 1)
		elif GetTalkListEntryResult() == 105:
			SetEventFlag(12005343, 1)
			SetEventFlag(12000343, 0)
		#Reduced FP Consumption (+15%)
		elif GetTalkListEntryResult() == 6:
			GiveSpEffectToPlayer(8010101)
			SetEventFlag(12000344, 1)
		elif GetTalkListEntryResult() == 106:
			SetEventFlag(12005344, 1)
			SetEventFlag(12000344, 0)
		#Increased Max Stamina (+10%)
		elif GetTalkListEntryResult() == 7:
			GiveSpEffectToPlayer(8020000)
			SetEventFlag(12000345, 1)
		elif GetTalkListEntryResult() == 107:
			SetEventFlag(12005345, 1)
			SetEventFlag(12000345, 0)
		#Increased Max Stamina (+15%)
		elif GetTalkListEntryResult() == 8:
			GiveSpEffectToPlayer(8020001)
			SetEventFlag(12000346, 1)
		elif GetTalkListEntryResult() == 108:
			SetEventFlag(12005346, 1)
			SetEventFlag(12000346, 0)
		#Improved Stamina Recovery (+4)
		elif GetTalkListEntryResult() == 9:
			GiveSpEffectToPlayer(8020200)
			SetEventFlag(12000347, 1)
		elif GetTalkListEntryResult() == 109:
			SetEventFlag(12005347, 1)
			SetEventFlag(12000347, 0)
		#Improved Stamina Recovery (+6)
		elif GetTalkListEntryResult() == 10:
			GiveSpEffectToPlayer(8020201)
			SetEventFlag(12000348, 1)
		elif GetTalkListEntryResult() == 110:
			SetEventFlag(12005348, 1)
			SetEventFlag(12000348, 0)
		#Improved Sorceries and Incantations (+7%)
		elif GetTalkListEntryResult() == 11:
			GiveSpEffectToPlayer(8330103)
			SetEventFlag(12000349, 1)
		elif GetTalkListEntryResult() == 111:
			SetEventFlag(12005349, 1)
			SetEventFlag(12000349, 0)
		#Improved Sorceries and Incantations (+11%)
		elif GetTalkListEntryResult() == 12:
			GiveSpEffectToPlayer(8330104)
			SetEventFlag(12000350, 1)
		elif GetTalkListEntryResult() == 112:
			SetEventFlag(12005350, 1)
			SetEventFlag(12000350, 0)
		#Extended Sorcery and Incantation Duration (+100%)
		elif GetTalkListEntryResult() == 13:
			GiveSpEffectToPlayer(8330500)
			SetEventFlag(12000351, 1)
		elif GetTalkListEntryResult() == 113:
			SetEventFlag(12005351, 1)
			SetEventFlag(12000351, 0)
		#Improved Ultimate Art Gauge Charge Speed (+6%)
		elif GetTalkListEntryResult() == 14:
			GiveSpEffectToPlayer(8360000)
			SetEventFlag(12000352, 1)
		elif GetTalkListEntryResult() == 114:
			SetEventFlag(12005352, 1)
			SetEventFlag(12000352, 0)
		#Character Skill Cooldown Reduction (+10%)
		elif GetTalkListEntryResult() == 15:
			GiveSpEffectToPlayer(8370000)
			SetEventFlag(12000353, 1)
		elif GetTalkListEntryResult() == 115:
			SetEventFlag(12005353, 1)
			SetEventFlag(12000353, 0)
		#FP Restoration upon Successive Attacks (+10%)
		elif GetTalkListEntryResult() == 16:
			GiveSpEffectToPlayer(8610100)
			SetEventFlag(12000354, 1)
		elif GetTalkListEntryResult() == 116:
			SetEventFlag(12005354, 1)
			SetEventFlag(12000354, 0)
		#Critical Hit FP Restoration (+10%)
		elif GetTalkListEntryResult() == 17:
			GiveSpEffectToPlayer(8640100)
			SetEventFlag(12000355, 1)
		elif GetTalkListEntryResult() == 117:
			SetEventFlag(12005355, 1)
			SetEventFlag(12000355, 0)
		#FP Recovery From Successful Guarding (+2)
		elif GetTalkListEntryResult() == 18:
			GiveSpEffectToPlayer(8650100)
			SetEventFlag(12000356, 1)
		elif GetTalkListEntryResult() == 118:
			SetEventFlag(12005356, 1)
			SetEventFlag(12000356, 0)
		#Creates Holy Ground at Low HP
		elif GetTalkListEntryResult() == 19:
			GiveSpEffectToPlayer(8660300)
			SetEventFlag(12000357, 1)
		elif GetTalkListEntryResult() == 119:
			SetEventFlag(12005357, 1)
			SetEventFlag(12000357, 0)
		#Unifying Fate (Flask also restores FP)
		elif GetTalkListEntryResult() == 20:
			GiveSpEffectToPlayer(8970020)
			SetEventFlag(12000358, 1)
		elif GetTalkListEntryResult() == 120:
			SetEventFlag(12005358, 1)
			SetEventFlag(12000358, 0)
		else:
			return 0
		assert GetCurrentStateElapsedFrames(2)

#cheats
def t600001000_x930():
	while True:
		ClearTalkListData()
		ClearPreviousMenuSelection()
		#infinite revives
		AddTalkListDataIf(GetEventFlag(12000202), 1, 6232044, -1) #on
		AddTalkListDataIf(not GetEventFlag(12000202), 2, 6232045, -1) #off
		#go back
		AddTalkListData(99, 6232999, -1)
		ShowShopMessage(TalkOptionsType.Regular)
		assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#infinite revives
		if GetTalkListEntryResult() == 1:
			SetEventFlag(12000202, 0)
		elif GetTalkListEntryResult() == 2:
			SetEventFlag(12000202, 1)
		else:
			return 0
	
#options
def t600001000_x931():
	while True:
		ClearTalkListData()
		ClearPreviousMenuSelection()
		#respawn location
		AddTalkListDataIf(GetEventFlag(12000204), 1, 6232051, -1) #arena
		AddTalkListDataIf(GetEventFlag(12000205), 2, 6232050, -1) #roundtable
		AddTalkListDataIf(GetEventFlag(12000206), 3, 6232052, -1) #ask
		#start battle with 1 revive
		AddTalkListDataIf(GetEventFlag(12000207), 4, 6232053, -1) #on
		AddTalkListDataIf(not GetEventFlag(12000207), 5, 6232054, -1) #off
		#after boss defeat
		AddTalkListDataIf(GetEventFlag(12000214), 6, 6232550, -1) #warp to roundtable
		AddTalkListDataIf(GetEventFlag(12000215), 7, 6232552, -1) #spawn grace
		AddTalkListDataIf(GetEventFlag(12000216), 8, 6232551, -1) #do nothing
		#display blinking messages
		AddTalkListDataIf(GetEventFlag(12000217) and GetEventFlag(12000214), 9, 6232553, -1) #on
		AddTalkListDataIf(not GetEventFlag(12000217) and GetEventFlag(12000214), 10, 6232554, -1) #off
		#go back
		AddTalkListData(99, 6232999, -1)
		ShowShopMessage(TalkOptionsType.Regular)
		assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
		#respawn location
		if GetTalkListEntryResult() == 1:
			SetEventFlag(12000204, 0)
			SetEventFlag(12000205, 1)
			SetEventFlag(12000206, 0)
		elif GetTalkListEntryResult() == 2:
			SetEventFlag(12000204, 0)
			SetEventFlag(12000205, 0)
			SetEventFlag(12000206, 1)
		elif GetTalkListEntryResult() == 3:
			SetEventFlag(12000204, 1)
			SetEventFlag(12000205, 0)
			SetEventFlag(12000206, 0)
		#start battle with 1 revive
		elif GetTalkListEntryResult() == 4:
			SetEventFlag(12000207, 0)
		elif GetTalkListEntryResult() == 5:
			SetEventFlag(12000207, 1)
		#after boss defeat
		elif GetTalkListEntryResult() == 6:
			SetEventFlag(12000214, 0)
			SetEventFlag(12000215, 1)
			SetEventFlag(12000216, 0)
		elif GetTalkListEntryResult() == 7:
			SetEventFlag(12000214, 0)
			SetEventFlag(12000215, 0)
			SetEventFlag(12000216, 1)
		elif GetTalkListEntryResult() == 8:
			SetEventFlag(12000214, 1)
			SetEventFlag(12000215, 0)
			SetEventFlag(12000216, 0)
		#display blinking messages
		elif GetTalkListEntryResult() == 9:
			SetEventFlag(12000217, 0)
		elif GetTalkListEntryResult() == 10:
			SetEventFlag(12000217, 1)
		else:
			return 0

def t600001000_x0():
	"""State 0,1"""
	if not CheckSpecificPersonTalkHasEnded(0):
		"""State 7"""
		ClearTalkProgressData()
		StopEventAnimWithoutForcingConversationEnd(0)
		"""State 6"""
		ReportConversationEndToHavokBehavior()
	else:
		pass
	"""State 2"""
	if CheckSpecificPersonGenericDialogIsOpen(0):
		"""State 3"""
		ForceCloseGenericDialog()
	else:
		pass
	"""State 4"""
	if CheckSpecificPersonMenuIsOpen(-1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0):
		"""State 5"""
		ForceCloseMenu()
	else:
		pass
	"""State 8"""
	return 0

def t600001000_x1(actionbutton1=_, flag1=6001, flag2=6000):
	"""State 0"""
	while True:
		"""State 1,2,4"""
		# eventflag:6000:Flag to always be OFF
		if GetEventFlag(flag2):
			"""State 5"""
			# eventflag:6001:Flag to always be ON
			# eventflag:6000:Flag to always be OFF
			assert GetEventFlag(flag1) and not GetEventFlag(flag2)
			"""State 6"""
			assert GetCurrentStateElapsedTime() > 1
		# eventflag:6001:Flag to always be ON
		# eventflag:6000:Flag to always be OFF
		elif GetEventFlag(flag1) and not GetEventFlag(flag2):
			pass
		"""State 3"""
		if CheckActionButtonArea(actionbutton1):
			break
		# eventflag:6001:Flag to always be ON
		# eventflag:6000:Flag to always be OFF
		elif not GetEventFlag(flag1) or GetEventFlag(flag2):
			pass
	"""State 7"""
	return 0

def t600001000_x2(goods3=1000):
	"""State 0,1"""
	# goods:1001:Flask of Crimson Tears
	# goods:1000:Flask of Crimson Tears
	if (DoesPlayerHaveItem(ItemType.Goods, goods3 + 1 + 0 * 50 + 0 * 2) or DoesPlayerHaveItem(ItemType.Goods, goods3
		+ 0 + 0 * 50 + 0 * 2)):
		"""State 2"""
		BonfireActivation(1)
		"""State 13"""
		Label('L0')
		"""State 18"""
		assert t600001000_x3(goods3=goods3)
	# goods:1003:Flask of Crimson Tears +1
	# goods:1002:Flask of Crimson Tears +1
	elif (DoesPlayerHaveItem(ItemType.Goods, goods3 + 1 + 0 * 50 + 1 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods3 + 0 + 0 * 50 + 1 * 2)):
		"""State 3"""
		BonfireActivation(2)
		Goto('L0')
	# goods:1005:Flask of Crimson Tears +2
	# goods:1004:Flask of Crimson Tears +2
	elif (DoesPlayerHaveItem(ItemType.Goods, goods3 + 1 + 0 * 50 + 2 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods3 + 0 + 0 * 50 + 2 * 2)):
		"""State 4"""
		BonfireActivation(3)
		Goto('L0')
	# goods:1007:Flask of Crimson Tears +3
	# goods:1006:Flask of Crimson Tears +3
	elif (DoesPlayerHaveItem(ItemType.Goods, goods3 + 1 + 0 * 50 + 3 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods3 + 0 + 0 * 50 + 3 * 2)):
		"""State 5"""
		BonfireActivation(4)
		Goto('L0')
	# goods:1009:Flask of Crimson Tears +4
	# goods:1008:Flask of Crimson Tears +4
	elif (DoesPlayerHaveItem(ItemType.Goods, goods3 + 1 + 0 * 50 + 4 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods3 + 0 + 0 * 50 + 4 * 2)):
		"""State 6"""
		BonfireActivation(5)
		Goto('L0')
	# goods:1011:Flask of Crimson Tears +5
	# goods:1010:Flask of Crimson Tears +5
	elif (DoesPlayerHaveItem(ItemType.Goods, goods3 + 1 + 0 * 50 + 5 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods3 + 0 + 0 * 50 + 5 * 2)):
		"""State 7"""
		BonfireActivation(6)
		Goto('L0')
	# goods:1013:Flask of Crimson Tears +6
	# goods:1012:Flask of Crimson Tears +6
	elif (DoesPlayerHaveItem(ItemType.Goods, goods3 + 1 + 0 * 50 + 6 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods3 + 0 + 0 * 50 + 6 * 2)):
		"""State 8"""
		BonfireActivation(7)
		Goto('L0')
	# goods:1015:Flask of Crimson Tears +7
	# goods:1014:Flask of Crimson Tears +7
	elif (DoesPlayerHaveItem(ItemType.Goods, goods3 + 1 + 0 * 50 + 7 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods3 + 0 + 0 * 50 + 7 * 2)):
		"""State 9"""
		BonfireActivation(8)
		Goto('L0')
	# goods:1017:Flask of Crimson Tears +8
	# goods:1016:Flask of Crimson Tears +8
	elif (DoesPlayerHaveItem(ItemType.Goods, goods3 + 1 + 0 * 50 + 8 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods3 + 0 + 0 * 50 + 8 * 2)):
		"""State 10"""
		BonfireActivation(9)
		Goto('L0')
	# goods:1019:Flask of Crimson Tears +9
	# goods:1018:Flask of Crimson Tears +9
	elif (DoesPlayerHaveItem(ItemType.Goods, goods3 + 1 + 0 * 50 + 9 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods3 + 0 + 0 * 50 + 9 * 2)):
		"""State 11"""
		BonfireActivation(10)
		Goto('L0')
	# goods:1021:Flask of Crimson Tears +10
	# goods:1020:Flask of Crimson Tears +10
	elif (DoesPlayerHaveItem(ItemType.Goods, goods3 + 1 + 0 * 50 + 10 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods3 + 0 + 0 * 50 + 10 * 2)):
		"""State 12"""
		BonfireActivation(11)
		Goto('L0')
	elif True:
		"""State 15"""
		pass
	# goods:1023:Flask of Crimson Tears +11
	# goods:1022:Flask of Crimson Tears +11
	elif (DoesPlayerHaveItem(ItemType.Goods, goods3 + 1 + 0 * 50 + 11 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods3 + 0 + 0 * 50 + 11 * 2)):
		"""State 16"""
		BonfireActivation(12)
		Goto('L0')
	# goods:1025:Flask of Crimson Tears +12
	# goods:1024:Flask of Crimson Tears +12
	elif (DoesPlayerHaveItem(ItemType.Goods, goods3 + 1 + 0 * 50 + 12 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods3 + 0 + 0 * 50 + 12 * 2)):
		"""State 17"""
		BonfireActivation(13)
		Goto('L0')
	"""State 14,19"""
	return 0

def t600001000_x3(goods3=1000):
	"""State 0,15"""
	# goods:1000:Flask of Crimson Tears
	# goods:1002:Flask of Crimson Tears +1
	# goods:1004:Flask of Crimson Tears +2
	# goods:1006:Flask of Crimson Tears +3
	# goods:1008:Flask of Crimson Tears +4
	# goods:1010:Flask of Crimson Tears +5
	# goods:1012:Flask of Crimson Tears +6
	# goods:1014:Flask of Crimson Tears +7
	call = t600001000_x6(goods3=goods3, goods4=0, goods5=0)
	if call.Get() == 1:
		"""State 1,11"""
		# goods:1000:Flask of Crimson Tears
		# goods:1002:Flask of Crimson Tears +1
		# goods:1004:Flask of Crimson Tears +2
		# goods:1006:Flask of Crimson Tears +3
		# goods:1008:Flask of Crimson Tears +4
		# goods:1010:Flask of Crimson Tears +5
		# goods:1012:Flask of Crimson Tears +6
		# goods:1014:Flask of Crimson Tears +7
		# goods:1016:Flask of Crimson Tears +8
		# goods:1018:Flask of Crimson Tears +9
		assert t600001000_x4(goods3=goods3, goods6=0, goods7=0)
	elif call.Done():
		"""State 16"""
		# goods:1001:Flask of Crimson Tears
		# goods:1003:Flask of Crimson Tears +1
		# goods:1005:Flask of Crimson Tears +2
		# goods:1007:Flask of Crimson Tears +3
		# goods:1009:Flask of Crimson Tears +4
		# goods:1011:Flask of Crimson Tears +5
		# goods:1013:Flask of Crimson Tears +6
		# goods:1015:Flask of Crimson Tears +7
		call = t600001000_x6(goods3=goods3, goods4=0, goods5=1)
		if call.Get() == 1:
			"""State 8,10"""
			# goods:1001:Flask of Crimson Tears
			# goods:1003:Flask of Crimson Tears +1
			# goods:1005:Flask of Crimson Tears +2
			# goods:1007:Flask of Crimson Tears +3
			# goods:1009:Flask of Crimson Tears +4
			# goods:1011:Flask of Crimson Tears +5
			# goods:1013:Flask of Crimson Tears +6
			# goods:1015:Flask of Crimson Tears +7
			# goods:1017:Flask of Crimson Tears +8
			# goods:1019:Flask of Crimson Tears +9
			assert t600001000_x4(goods3=goods3, goods6=0, goods7=1)
		elif call.Done():
			"""State 2"""
			pass
	"""State 5,17"""
	# goods:1050:Flask of Cerulean Tears
	# goods:1052:Flask of Cerulean Tears +1
	# goods:1054:Flask of Cerulean Tears +2
	# goods:1056:Flask of Cerulean Tears +3
	# goods:1058:Flask of Cerulean Tears +4
	# goods:1060:Flask of Cerulean Tears +5
	# goods:1062:Flask of Cerulean Tears +6
	# goods:1064:Flask of Cerulean Tears +7
	call = t600001000_x6(goods3=goods3, goods4=1, goods5=0)
	if call.Get() == 1:
		"""State 3,13"""
		# goods:1050:Flask of Cerulean Tears
		# goods:1052:Flask of Cerulean Tears +1
		# goods:1054:Flask of Cerulean Tears +2
		# goods:1056:Flask of Cerulean Tears +3
		# goods:1058:Flask of Cerulean Tears +4
		# goods:1060:Flask of Cerulean Tears +5
		# goods:1062:Flask of Cerulean Tears +6
		# goods:1064:Flask of Cerulean Tears +7
		# goods:1066:Flask of Cerulean Tears +8
		# goods:1068:Flask of Cerulean Tears +9
		assert t600001000_x4(goods3=goods3, goods6=1, goods7=0)
	elif call.Done():
		"""State 18"""
		# goods:1051:Flask of Cerulean Tears
		# goods:1053:Flask of Cerulean Tears +1
		# goods:1055:Flask of Cerulean Tears +2
		# goods:1057:Flask of Cerulean Tears +3
		# goods:1059:Flask of Cerulean Tears +4
		# goods:1061:Flask of Cerulean Tears +5
		# goods:1063:Flask of Cerulean Tears +6
		# goods:1065:Flask of Cerulean Tears +7
		call = t600001000_x6(goods3=goods3, goods4=1, goods5=1)
		if call.Get() == 1:
			"""State 9,12"""
			# goods:1051:Flask of Cerulean Tears
			# goods:1053:Flask of Cerulean Tears +1
			# goods:1055:Flask of Cerulean Tears +2
			# goods:1057:Flask of Cerulean Tears +3
			# goods:1059:Flask of Cerulean Tears +4
			# goods:1061:Flask of Cerulean Tears +5
			# goods:1063:Flask of Cerulean Tears +6
			# goods:1065:Flask of Cerulean Tears +7
			# goods:1067:Flask of Cerulean Tears +8
			# goods:1069:Flask of Cerulean Tears +9
			assert t600001000_x4(goods3=goods3, goods6=1, goods7=1)
		elif call.Done():
			"""State 4"""
			pass
	"""State 6,14"""
	assert t600001000_x5()
	"""State 7,19"""
	return 0

def t600001000_x4(goods3=1000, goods6=_, goods7=_):
	"""State 0,1"""
	if DoesPlayerHaveItem(ItemType.Goods, goods3 + goods7 + goods6 * 50 + 0 * 2):
		"""State 3"""
		ReplaceTool(goods3 + goods6 * 50 + 0 * 2 + goods7, goods3 + goods6 * 50 + goods7 + 2 * (GetTotalBonfireLevel() - 1),
					1)
	elif DoesPlayerHaveItem(ItemType.Goods, goods3 + goods7 + goods6 * 50 + 1 * 2):
		"""State 4"""
		ReplaceTool(goods3 + goods6 * 50 + 1 * 2 + goods7, goods3 + goods6 * 50 + goods7 + 2 * (GetTotalBonfireLevel() - 1),
					1)
	elif DoesPlayerHaveItem(ItemType.Goods, goods3 + goods7 + goods6 * 50 + 2 * 2):
		"""State 5"""
		ReplaceTool(goods3 + goods6 * 50 + 2 * 2 + goods7, goods3 + goods6 * 50 + goods7 + 2 * (GetTotalBonfireLevel() - 1),
					1)
	elif DoesPlayerHaveItem(ItemType.Goods, goods3 + goods7 + goods6 * 50 + 3 * 2):
		"""State 6"""
		ReplaceTool(goods3 + goods6 * 50 + 3 * 2 + goods7, goods3 + goods6 * 50 + goods7 + 2 * (GetTotalBonfireLevel() - 1),
					1)
	elif DoesPlayerHaveItem(ItemType.Goods, goods3 + goods7 + goods6 * 50 + 4 * 2):
		"""State 7"""
		ReplaceTool(goods3 + goods6 * 50 + 4 * 2 + goods7, goods3 + goods6 * 50 + goods7 + 2 * (GetTotalBonfireLevel() - 1),
					1)
	elif DoesPlayerHaveItem(ItemType.Goods, goods3 + goods7 + goods6 * 50 + 5 * 2):
		"""State 8"""
		ReplaceTool(goods3 + goods6 * 50 + 5 * 2 + goods7, goods3 + goods6 * 50 + goods7 + 2 * (GetTotalBonfireLevel() - 1),
					1)
	elif DoesPlayerHaveItem(ItemType.Goods, goods3 + goods7 + goods6 * 50 + 6 * 2):
		"""State 9"""
		ReplaceTool(goods3 + goods6 * 50 + 6 * 2 + goods7, goods3 + goods6 * 50 + goods7 + 2 * (GetTotalBonfireLevel() - 1),
					1)
	else:
		"""State 2"""
		pass
	"""State 13"""
	return 0
	"""Unused"""
	"""State 10"""
	ReplaceTool(goods3 + goods6 * 50 + 7 * 2 + goods7, goods3 + goods6 * 50 + goods7 + 2 * (GetTotalBonfireLevel() - 1),
				1)
	Quit()
	"""State 11"""
	ReplaceTool(goods3 + goods6 * 50 + 8 * 2 + goods7, goods3 + goods6 * 50 + goods7 + 2 * (GetTotalBonfireLevel() - 1),
				1)
	Quit()
	"""State 12"""
	ReplaceTool(goods3 + goods6 * 50 + 9 * 2 + goods7, goods3 + goods6 * 50 + goods7 + 2 * (GetTotalBonfireLevel() - 1),
				1)
	Quit()

def t600001000_x5():
	"""State 0,1,13,14"""
	return 0
	"""Unused"""
	"""State 2,3,4"""
	Quit()
	"""State 5"""
	Quit()
	"""State 6"""
	Quit()
	"""State 7"""
	Quit()
	"""State 8"""
	Quit()
	"""State 9"""
	Quit()
	"""State 10"""
	Quit()
	"""State 11"""
	Quit()
	"""State 12"""
	Quit()

def t600001000_x6(goods3=1000, goods4=_, goods5=_):
	"""State 0,1"""
	if (not DoesPlayerHaveItem(ItemType.Goods, goods3 + goods5 + goods4 * 50 + 0 * 2) and not DoesPlayerHaveItem(ItemType.Goods,
		goods3 + goods5 + goods4 * 50 + 1 * 2) and not DoesPlayerHaveItem(ItemType.Goods, goods3 + goods5 + goods4
		* 50 + 2 * 2) and not DoesPlayerHaveItem(ItemType.Goods, goods3 + goods5 + goods4 * 50 + 3 * 2) and not
		DoesPlayerHaveItem(ItemType.Goods, goods3 + goods5 + goods4 * 50 + 4 * 2) and not DoesPlayerHaveItem(ItemType.Goods,
		goods3 + goods5 + goods4 * 50 + 5 * 2) and not DoesPlayerHaveItem(ItemType.Goods, goods3 + goods5 + goods4
		* 50 + 6 * 2) and not DoesPlayerHaveItem(ItemType.Goods, goods3 + goods5 + goods4 * 50 + 7 * 2)):
		"""State 2,3"""
		return 0
	else:
		"""State 4"""
		return 1

def t600001000_x7(goods1=1000):
	"""State 0,3"""
	# goods:1000:Flask of Crimson Tears
	# goods:1001:Flask of Crimson Tears
	# goods:1002:Flask of Crimson Tears +1
	# goods:1003:Flask of Crimson Tears +1
	# goods:1004:Flask of Crimson Tears +2
	# goods:1005:Flask of Crimson Tears +2
	# goods:1006:Flask of Crimson Tears +3
	# goods:1007:Flask of Crimson Tears +3
	# goods:1008:Flask of Crimson Tears +4
	# goods:1009:Flask of Crimson Tears +4
	# goods:1010:Flask of Crimson Tears +5
	# goods:1011:Flask of Crimson Tears +5
	# goods:1012:Flask of Crimson Tears +6
	# goods:1013:Flask of Crimson Tears +6
	# goods:1014:Flask of Crimson Tears +7
	# goods:1015:Flask of Crimson Tears +7
	# goods:1016:Flask of Crimson Tears +8
	# goods:1017:Flask of Crimson Tears +8
	# goods:1018:Flask of Crimson Tears +9
	# goods:1019:Flask of Crimson Tears +9
	# goods:1020:Flask of Crimson Tears +10
	# goods:1021:Flask of Crimson Tears +10
	# goods:1022:Flask of Crimson Tears +11
	# goods:1023:Flask of Crimson Tears +11
	# goods:1024:Flask of Crimson Tears +12
	# goods:1025:Flask of Crimson Tears +12
	call = t600001000_x8(goods1=goods1, goods2=0, z2=1)
	if call.Get() == 1:
		"""State 4"""
		assert t600001000_x9(goods1=goods1, mode1=0, z1=GetWorkValue(1))
		"""State 5"""
		assert t600001000_x9(goods1=goods1, mode1=1, z1=GetWorkValue(1))
	elif call.Done():
		"""State 1"""
		pass
	"""State 2"""
	SetWorkValue(1, 0)
	"""State 6"""
	return 0

def t600001000_x8(goods1=1000, goods2=0, z2=1):
	"""State 0,13"""
	SetWorkValue(z2, 0)
	# goods:1000:Flask of Crimson Tears
	# goods:1001:Flask of Crimson Tears
	if (DoesPlayerHaveItem(ItemType.Goods, goods1 + 0 + goods2 * 50 + 0 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		goods1 + 1 + goods2 * 50 + 0 * 2)):
		"""State 1"""
		SetWorkValue(z2, 0)
	# goods:1002:Flask of Crimson Tears +1
	# goods:1003:Flask of Crimson Tears +1
	elif (DoesPlayerHaveItem(ItemType.Goods, goods1 + 0 + goods2 * 50 + 1 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods1 + 1 + goods2 * 50 + 1 * 2)):
		"""State 2"""
		SetWorkValue(z2, 1)
	# goods:1004:Flask of Crimson Tears +2
	# goods:1005:Flask of Crimson Tears +2
	elif (DoesPlayerHaveItem(ItemType.Goods, goods1 + 0 + goods2 * 50 + 2 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods1 + 1 + goods2 * 50 + 2 * 2)):
		"""State 3"""
		SetWorkValue(z2, 2)
	# goods:1006:Flask of Crimson Tears +3
	# goods:1007:Flask of Crimson Tears +3
	elif (DoesPlayerHaveItem(ItemType.Goods, goods1 + 0 + goods2 * 50 + 3 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods1 + 1 + goods2 * 50 + 3 * 2)):
		"""State 4"""
		SetWorkValue(z2, 3)
	# goods:1008:Flask of Crimson Tears +4
	# goods:1009:Flask of Crimson Tears +4
	elif (DoesPlayerHaveItem(ItemType.Goods, goods1 + 0 + goods2 * 50 + 4 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods1 + 1 + goods2 * 50 + 4 * 2)):
		"""State 5"""
		SetWorkValue(z2, 4)
	# goods:1010:Flask of Crimson Tears +5
	# goods:1011:Flask of Crimson Tears +5
	elif (DoesPlayerHaveItem(ItemType.Goods, goods1 + 0 + goods2 * 50 + 5 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods1 + 1 + goods2 * 50 + 5 * 2)):
		"""State 6"""
		SetWorkValue(z2, 5)
	# goods:1012:Flask of Crimson Tears +6
	# goods:1013:Flask of Crimson Tears +6
	elif (DoesPlayerHaveItem(ItemType.Goods, goods1 + 0 + goods2 * 50 + 6 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods1 + 1 + goods2 * 50 + 6 * 2)):
		"""State 7"""
		SetWorkValue(z2, 6)
	# goods:1014:Flask of Crimson Tears +7
	# goods:1015:Flask of Crimson Tears +7
	elif (DoesPlayerHaveItem(ItemType.Goods, goods1 + 0 + goods2 * 50 + 7 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods1 + 1 + goods2 * 50 + 7 * 2)):
		"""State 8"""
		SetWorkValue(z2, 7)
	# goods:1016:Flask of Crimson Tears +8
	# goods:1017:Flask of Crimson Tears +8
	elif (DoesPlayerHaveItem(ItemType.Goods, goods1 + 0 + goods2 * 50 + 8 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods1 + 1 + goods2 * 50 + 8 * 2)):
		"""State 9"""
		SetWorkValue(z2, 8)
	# goods:1018:Flask of Crimson Tears +9
	# goods:1019:Flask of Crimson Tears +9
	elif (DoesPlayerHaveItem(ItemType.Goods, goods1 + 0 + goods2 * 50 + 9 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods1 + 1 + goods2 * 50 + 9 * 2)):
		"""State 10"""
		SetWorkValue(z2, 9)
	# goods:1020:Flask of Crimson Tears +10
	# goods:1021:Flask of Crimson Tears +10
	elif (DoesPlayerHaveItem(ItemType.Goods, goods1 + 0 + goods2 * 50 + 10 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods1 + 1 + goods2 * 50 + 10 * 2)):
		"""State 11"""
		SetWorkValue(z2, 10)
	# goods:1022:Flask of Crimson Tears +11
	# goods:1023:Flask of Crimson Tears +11
	elif (DoesPlayerHaveItem(ItemType.Goods, goods1 + 0 + goods2 * 50 + 11 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods1 + 1 + goods2 * 50 + 11 * 2)):
		"""State 14"""
		SetWorkValue(z2, 11)
	# goods:1024:Flask of Crimson Tears +12
	# goods:1025:Flask of Crimson Tears +12
	elif (DoesPlayerHaveItem(ItemType.Goods, goods1 + 0 + goods2 * 50 + 12 * 2) or DoesPlayerHaveItem(ItemType.Goods,
		  goods1 + 1 + goods2 * 50 + 12 * 2)):
		"""State 15"""
		SetWorkValue(z2, 12)
	else:
		"""State 12"""
		SetWorkValue(z2, 13)
		"""State 16"""
		return 0
	"""State 17"""
	return 1

def t600001000_x9(goods1=1000, mode1=_, z1=_):
	"""State 0,6"""
	if not GetEstusAllocation(mode1) < 0:
		"""State 7,12"""
		if (DoesPlayerHaveItem(ItemType.Goods, goods1 + 0 + mode1 * 50 + z1 * 2) or DoesPlayerHaveItem(ItemType.Goods,
			goods1 + 1 + mode1 * 50 + z1 * 2)):
			"""State 13,1"""
			if DoesPlayerHaveItem(ItemType.Goods, goods1 + 0 + mode1 * 50 + z1 * 2):
				"""State 2,4"""
				ReplaceTool(1000 + mode1 * 50 + z1 * 2 + 0, 1000 + mode1 * 50 + z1 * 2 + 1, 1)
			else:
				"""State 3"""
				pass
			while True:
				"""State 5"""
				if (not ComparePlayerInventoryNumber(ItemType.Goods, 1000 + 1 + mode1 * 50 + z1 * 2, CompareType.GreaterOrEqual,
					GetEstusAllocation(mode1), False)):
					"""State 9,11"""
					PlayerEquipmentQuantityChange(ItemType.Goods, 1000 + 1 + mode1 * 50 + z1 * 2, 1)
				else:
					"""State 10"""
					break
		else:
			"""State 14"""
			pass
	else:
		"""State 8"""
		pass
	"""State 15"""
	return 0

def t600001000_x10():
	"""State 0,1"""
	if CheckSpecificPersonGenericDialogIsOpen(0):
		"""State 2"""
		ForceCloseGenericDialog()
	else:
		pass
	"""State 3"""
	if CheckSpecificPersonMenuIsOpen(-1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0):
		"""State 4"""
		ForceCloseMenu()
	else:
		pass
	"""State 5"""
	return 0

def t600001000_x11():
	"""State 0"""
	if not GetEventFlag(9000):
		"""State 2"""
		pass
	else:
		"""State 1"""
		pass
	while True:
		"""State 3"""
		if IsMultiplayerInProgress():
			"""State 5"""
			call = t600001000_x14()
			assert not IsMultiplayerInProgress()
		else:
			"""State 4"""
			def WhilePaused():
				GiveSpEffectToPlayerIf(GetEventFlag(9000) and GetWorkValue(0) == 0, 9607)
				GiveSpEffectToPlayerIf(GetEventFlag(9000) and GetWorkValue(0) == 10, 9608)
				GiveSpEffectToPlayerIf(GetEventFlag(9000) and GetDistanceToPlayer() < 1.05, 9609)
				GiveSpEffectToPlayerIf(GetEventFlag(4698) and GetEventFlag(9001), 9606)
			assert t600001000_x12()
	"""Unused"""
	"""State 6"""
	return 0

def t600001000_x12():
	"""State 0,1"""
	if True:
		"""State 2"""
		Label('L0')
		assert GetWhetherChrEventAnimHasEnded(10000)
	else:
		"""State 3,24"""
		call = t600001000_x21()
		if call.Done():
			"""State 7"""
			TurnCharacterToFaceEntity(-1, 10000, -1, -1)
			assert GetCurrentStateElapsedFrames() > 1 and GetWhetherChrEventAnimHasEnded(10000)
			"""State 4"""
			OfferHumanity()
			assert CompareBonfireLevel(CompareType.LessOrEqual, 0)
			"""State 9,10"""
			UpdatePlayerRespawnPoint()
			Goto('L0')
		elif CompareBonfireLevel(CompareType.LessOrEqual, 0) or GetEventFlag(11102790):
			pass
	"""State 25"""
	assert t600001000_x21()
	"""State 5"""
	ClearPlayerDamageInfo()
	"""State 11"""
	GiveSpEffectToPlayer(202)
	"""State 6"""
	SetTalkTime(1)
	"""State 22"""
	assert t600001000_x18()
	"""State 8"""
	TurnCharacterToFaceEntity(-1, 10000, -1, -1)
	assert GetCurrentStateElapsedFrames() > 1 and GetWhetherChrEventAnimHasEnded(10000)
	"""State 12"""
	UpdatePlayerRespawnPoint()
	"""State 17"""
	StartBonfireAnimLoop(0, 0, 0, 0, GetWorkValue(0), 0.5)
	"""State 13"""
	c1_117(0, 0, 0, 0, 0, 0, 0, 0.1, 0, 1.5, 0, 0.75, 0.5)
	"""State 16"""
	SetEventFlag(9000, FlagState.On)
	SetEventFlag(9020, FlagState.On)
	ChangeCameraIf(not GetEventFlag(11102790), 1001000)
	ChangeCameraIf(GetEventFlag(11102790), 1001001)
	"""State 15"""
	if not GetEventFlag(9001):
		"""State 19"""
		pass
	else:
		"""State 18"""
		assert not GetEventFlag(9001)
	"""State 23"""
	def WhilePaused():
		GiveSpEffectToPlayerIf(GetEventFlag(4651), 9620)
	def ExitPause():
		EndBonfireKindleAnimLoop(GetWorkValue(0))
	assert t600001000_x17()
	"""State 14"""
	Label('L1')
	SetEventFlag(9000, FlagState.Off)
	SetEventFlag(9020, FlagState.Off)
	ChangeCamera(-1)
	SetCanOpenMap(False)
	assert GetCurrentStateElapsedFrames() > 1
	"""State 20"""
	if not GetEventFlag(1042369415):
		Goto('L0')
	else:
		"""State 26"""
		return 0
	"""Unused"""
	"""State 21"""
	assert t600001000_x13()
	Goto('L1')

def t600001000_x13():
	"""State 0,1"""
	assert t600001000_x0()
	"""State 2"""
	return 0

def t600001000_x14():
	"""State 0"""
	while True:
		"""State 1"""
		call = t600001000_x15()
		assert IsClientPlayer()
		"""State 2"""
		call = t600001000_x16()
		assert not IsClientPlayer()
	"""Unused"""
	"""State 3"""
	return 0

def t600001000_x15():
	"""State 0,6"""
	call = t600001000_x0()
	if call.Done() and CompareBonfireLevel(CompareType.LessOrEqual, 0):
		pass
	elif call.Done():
		"""State 2,7"""
		# eventflag:6001:Flag to always be ON
		# eventflag:6000:Flag to always be OFF
		call = t600001000_x1(actionbutton1=6100, flag1=6001, flag2=6000)
		if call.Done():
			"""State 4"""
			TurnCharacterToFaceEntity(-1, 10000, -1, -1)
			assert GetCurrentStateElapsedFrames() > 1 and GetWhetherChrEventAnimHasEnded(10000)
			"""State 3"""
			OfferHumanity()
			"""State 5"""
			UpdatePlayerRespawnPoint()
			assert CompareBonfireLevel(CompareType.LessOrEqual, 0)
		elif CompareBonfireLevel(CompareType.LessOrEqual, 0):
			pass
	"""State 1"""
	Quit()
	"""Unused"""
	"""State 8"""
	return 0

def t600001000_x16():
	"""State 0,1"""
	assert t600001000_x0()
	"""State 2"""
	return 0

def t600001000_x17():
	"""State 0,7"""
	assert GetCurrentStateElapsedTime() > 0.1 or not GetEventFlag(4651)
	"""State 8"""
	assert not GetEventFlag(9001)
	"""State 11"""
	# goods:1001:Flask of Crimson Tears
	# goods:1000:Flask of Crimson Tears
	# goods:1003:Flask of Crimson Tears +1
	# goods:1002:Flask of Crimson Tears +1
	# goods:1005:Flask of Crimson Tears +2
	# goods:1004:Flask of Crimson Tears +2
	# goods:1007:Flask of Crimson Tears +3
	# goods:1006:Flask of Crimson Tears +3
	# goods:1009:Flask of Crimson Tears +4
	# goods:1008:Flask of Crimson Tears +4
	# goods:1011:Flask of Crimson Tears +5
	# goods:1010:Flask of Crimson Tears +5
	# goods:1013:Flask of Crimson Tears +6
	# goods:1012:Flask of Crimson Tears +6
	# goods:1015:Flask of Crimson Tears +7
	# goods:1014:Flask of Crimson Tears +7
	# goods:1017:Flask of Crimson Tears +8
	# goods:1016:Flask of Crimson Tears +8
	# goods:1019:Flask of Crimson Tears +9
	# goods:1018:Flask of Crimson Tears +9
	# goods:1021:Flask of Crimson Tears +10
	# goods:1020:Flask of Crimson Tears +10
	# goods:1023:Flask of Crimson Tears +11
	# goods:1022:Flask of Crimson Tears +11
	# goods:1025:Flask of Crimson Tears +12
	# goods:1024:Flask of Crimson Tears +12
	# goods:1050:Flask of Cerulean Tears
	# goods:1051:Flask of Cerulean Tears
	# goods:1052:Flask of Cerulean Tears +1
	# goods:1053:Flask of Cerulean Tears +1
	# goods:1054:Flask of Cerulean Tears +2
	# goods:1055:Flask of Cerulean Tears +2
	# goods:1056:Flask of Cerulean Tears +3
	# goods:1057:Flask of Cerulean Tears +3
	# goods:1058:Flask of Cerulean Tears +4
	# goods:1059:Flask of Cerulean Tears +4
	# goods:1060:Flask of Cerulean Tears +5
	# goods:1061:Flask of Cerulean Tears +5
	# goods:1062:Flask of Cerulean Tears +6
	# goods:1063:Flask of Cerulean Tears +6
	# goods:1064:Flask of Cerulean Tears +7
	# goods:1065:Flask of Cerulean Tears +7
	# goods:1067:Flask of Cerulean Tears +8
	# goods:1066:Flask of Cerulean Tears +8
	# goods:1069:Flask of Cerulean Tears +9
	# goods:1068:Flask of Cerulean Tears +9
	assert t600001000_x2(goods3=1000)
	"""State 5"""
	ClearPreviousMenuSelection()
	"""State 1"""
	ClearTalkListData()
	"""State 2"""
	AddTalkListData(2, 15000540, -1)
	"""State 10,9"""
	# action:20000009:"Leave"
	AddTalkListData(99, 20000009, -1)
	"""State 3"""
	SetCanOpenMap(True)
	ShowShopMessage(TalkOptionsType.Regular)
	assert not (CheckSpecificPersonMenuIsOpen(1, 0) and not CheckSpecificPersonGenericDialogIsOpen(0))
	"""State 6"""
	if True:
		"""State 12"""
		assert t600001000_x19()
	else:
		"""State 4"""
		pass
	"""State 13"""
	return 0

def t600001000_x18():
	"""State 0,1"""
	if GetEventFlag(1054532702):
		"""State 2,4"""
		Label('L0')
		"""State 3"""
		SetWorkValue(0, 0)
	elif GetEventFlag(4698):
		"""State 8"""
		Goto('L0')
	elif GetEventFlag(11102790):
		"""State 6,7"""
		SetWorkValue(0, 30)
	else:
		"""State 5,9"""
		assert t600001000_x20()
	"""State 10"""
	return 0

def t600001000_x19():
	"""State 0,1"""
	OpenSoul()
	assert (not (CheckSpecificPersonMenuIsOpen(10, 0) and not CheckSpecificPersonGenericDialogIsOpen(0)) and GetCurrentStateElapsedTime()
			> 5)
	"""State 2"""
	return 0

def t600001000_x20():
	"""State 0,1"""
	if not CompareRNGValue(CompareType.Equal, 0) != -1:
		"""State 3,4"""
		ShuffleRNGSeed(100)
	else:
		"""State 2"""
		pass
	"""State 5"""
	SetRNGSeed()
	"""State 6"""
	if CompareRNGValue(CompareType.Less, 69) == True:
		"""State 7,8"""
		SetWorkValue(0, 0)
	elif CompareRNGValue(CompareType.Less, 99) == True:
		"""State 9,10"""
		SetWorkValue(0, 10)
	else:
		"""State 11,12"""
		SetWorkValue(0, 0)
	"""State 13"""
	return 0

def t600001000_x21():
	"""State 0,2"""
	assert t600001000_x22(actionbutton1=6100, actionbutton2=6101)
	"""State 3"""
	return 0
	"""Unused"""
	"""State 1"""
	Quit()

def t600001000_x22(actionbutton1=6100, actionbutton2=6101):
	"""State 0,1"""
	if CompareBonfireLevel(CompareType.Equal, 0):
		"""State 2,4"""
		# eventflag:6001:Flag to always be ON
		# eventflag:6000:Flag to always be OFF
		assert t600001000_x1(actionbutton1=actionbutton1, flag1=6001, flag2=6000)
	else:
		"""State 3,5"""
		# eventflag:6001:Flag to always be ON
		# eventflag:6000:Flag to always be OFF
		assert t600001000_x1(actionbutton1=actionbutton2, flag1=6001, flag2=6000)
	"""State 6"""
	return 0

def t600001000_x23(val1=9, val2=7):
	"""State 0"""
	while True:
		"""State 1"""
		# eventflag:7525:All bonfires disabled flag
		assert not IsCharacterDisabled() and CompareBonfireState(1) and not GetEventFlag(7525)
		"""State 2"""
		call = t600001000_x25(val1=val1, val2=val2)
		# eventflag:7525:All bonfires disabled flag
		assert IsCharacterDisabled() or CompareBonfireState(0) or GetEventFlag(7525)
	"""Unused"""
	"""State 3"""
	return 0

def t600001000_x24():
	"""State 0"""
	while True:
		"""State 1"""
		GiveSpEffectToPlayer(100)
		GiveSpEffectToPlayer(101)
		GiveSpEffectToPlayer(102)
		GiveSpEffectToPlayer(103)
		GiveSpEffectToPlayer(104)
		GiveSpEffectToPlayer(105)
		GiveSpEffectToPlayer(106)
		GiveSpEffectToPlayer(107)
		GiveSpEffectToPlayer(108)
		GiveSpEffectToPlayer(109)
		GiveSpEffectToPlayer(990000020)
		GiveSpEffectToPlayer(46284)
		"""State 2"""
		# goods:1000:Flask of Crimson Tears
		# goods:1001:Flask of Crimson Tears
		# goods:1002:Flask of Crimson Tears +1
		# goods:1003:Flask of Crimson Tears +1
		# goods:1004:Flask of Crimson Tears +2
		# goods:1005:Flask of Crimson Tears +2
		# goods:1006:Flask of Crimson Tears +3
		# goods:1007:Flask of Crimson Tears +3
		# goods:1008:Flask of Crimson Tears +4
		# goods:1009:Flask of Crimson Tears +4
		# goods:1010:Flask of Crimson Tears +5
		# goods:1011:Flask of Crimson Tears +5
		# goods:1012:Flask of Crimson Tears +6
		# goods:1013:Flask of Crimson Tears +6
		# goods:1014:Flask of Crimson Tears +7
		# goods:1015:Flask of Crimson Tears +7
		# goods:1016:Flask of Crimson Tears +8
		# goods:1017:Flask of Crimson Tears +8
		# goods:1018:Flask of Crimson Tears +9
		# goods:1019:Flask of Crimson Tears +9
		# goods:1020:Flask of Crimson Tears +10
		# goods:1021:Flask of Crimson Tears +10
		# goods:1022:Flask of Crimson Tears +11
		# goods:1023:Flask of Crimson Tears +11
		# goods:1024:Flask of Crimson Tears +12
		# goods:1025:Flask of Crimson Tears +12
		assert t600001000_x7(goods1=1000)
		"""State 3"""
		call = t600001000_x26()
		# goods:1000:Flask of Crimson Tears
		# goods:1001:Flask of Crimson Tears
		assert (DoesPlayerHaveItem(ItemType.Goods, 1000 + 0 + 0 * 50 + 0 * 2) or not ComparePlayerInventoryNumber(ItemType.Goods,
				1000 + 1 + 0 * 50 + 0 * 2, CompareType.GreaterOrEqual, GetEstusAllocation(EstusType.HP), False))
	"""Unused"""
	"""State 4"""
	return 0

def t600001000_x25(val1=9, val2=7):
	"""State 0"""
	while True:
		"""State 1"""
		assert GetDistanceToPlayer() < val2
		"""State 2"""
		c1_156()
		call = t600001000_x24()
		assert GetDistanceToPlayer() > val1
		"""State 3"""
		assert t600001000_x0()
	"""Unused"""
	"""State 4"""
	return 0

def t600001000_x26():
	"""State 0"""
	while True:
		"""State 1"""
		if GetPlayerStat(PlayerStat.RuneLevel) <= GetMaxRuneLevel():
			"""State 2"""
			SetWorkValue(0, 0)
			def ExitPause():
				SetWorkValue(0, 0)
			assert t600001000_x28()
		else:
			"""State 3"""
			assert t600001000_x28()
	"""Unused"""
	"""State 4"""
	return 0

def t600001000_x27():
	"""State 0,1"""
	# actionbutton:6112:"Already at highest level"
	# eventflag:6001:Flag to always be ON
	# eventflag:6000:Flag to always be OFF
	assert t600001000_x1(actionbutton1=6112, flag1=6001, flag2=6000)
	"""State 2"""
	return 0

def t600001000_x28():
	"""State 0,3"""
	SetWorkValue(0, GetLevelUpSoulCost(GetStatus(PlayerStat.RuneLevel), GetStatus(PlayerStat.RuneLevel) + 1))
	"""State 4"""
	SetMessageTagValue(0, GetWorkValue(0))
	"""State 5"""
	# actionbutton:6110:"Level up"
	# eventflag:6001:Flag to always be ON
	# eventflag:6000:Flag to always be OFF
	assert t600001000_x1(actionbutton1=6110, flag1=6001, flag2=6000)
	assert t600001000_x100() #to grace menu
	"""State 2"""
	if not (CheckSpecificPersonMenuIsOpen(10, 0) and not CheckSpecificPersonGenericDialogIsOpen(0)):
		pass
	elif GetDistanceToPlayer() > 9:
		"""State 6"""
		assert t600001000_x10()
	"""State 7"""
	return 0

