feat: implement costume weapon, sash skin, shining slots and enchants

This commit is contained in:
shen
2026-10-19 23:58:56 -07:00
parent f8bb455d9f
commit d63781e5fd
10 changed files with 299 additions and 110 deletions
+4 -4
View File
@@ -9,18 +9,18 @@ def source(name):return (SRC/name).read_bytes().decode('latin1')
il=source('common/item_length.h')
assert il.index('ITEM_BELT,')<il.index('ITEM_SHINING,')<il.index('ITEM_NEW_RINGS,')<il.index('enum EMetinSubTypes'),'AVA2 numbering 35/36'
length=source('common/length.h')
assert length.index('WEAR_PENDANT,\t\t// 27')<length.index('WEAR_RINGS_1,\t\t// 28')<length.index('WEAR_RINGS_2,\t\t// 29')<length.index('WEAR_MAX = 32')
assert length.index('WEAR_PENDANT,\t\t// 27')<length.index('WEAR_RINGS_1,\t\t// 28')<length.index('WEAR_RINGS_2,\t\t// 29')<length.index('WEAR_MAX = 40')
reader=source('db/src/ProtoReader.cpp')
types=reader[reader.index('string arType[]'):];types=types[:types.index('};')]
assert types.index('"ITEM_BELT"')<types.index('"ITEM_SHINING", "ITEM_NEW_RINGS"')
for name,rows in (('arSubType[] =',36),('arNumberOfSubtype[_countof(arSubType)] =',37)): # item types 0..36
for name,rows in (('arSubType[] =',37),('arNumberOfSubtype[_countof(arSubType)] =',38)): # item types 0..36
arr=reader[reader.index(name):];arr=arr[:arr.index('};')]
assert arr.count('\n\t\t')==rows,(name,arr.count('\n\t\t'))
item=source('game/src/item.cpp')
fec=item[item.index('int CItem::FindEquipCell('):item.index('void CItem::ModifyPoints(')]
assert 'ITEM_BELT != GetType() && ITEM_NEW_RINGS != GetType())' in fec
assert 'ITEM_BELT != GetType() && ITEM_NEW_RINGS != GetType()' in fec
assert 'if (ch->GetWear(WEAR_RINGS_1))\n\t\t\treturn WEAR_RINGS_2;\n\t\telse\n\t\t\treturn WEAR_RINGS_1;' in fec
assert '\tcase ITEM_BELT:\n\tcase ITEM_NEW_RINGS:\n\t\treturn true;' in item
assert '\tcase ITEM_BELT:\n\tcase ITEM_NEW_RINGS:' in item
assert '(m_pProto->bType == ITEM_BELT) || (m_pProto->bType == ITEM_NEW_RINGS);' in item
assert 'return GetVnum() == GetNewRingJewelVnum(item->GetVnum());' in item
items=source('game/src/char_item.cpp')