#!/usr/bin/env python3 """AVA2 new rings (docs/FEATURE-AVA2-UNLOCK.md P8): ITEM_NEW_RINGS (36) worn in WEAR_RINGS_1/2, socket accessories with AVA2's jewels, their own 20-row attribute pool reached through the 40250 switchers / adders.""" from pathlib import Path ROOT=Path(__file__).resolve().parents[2] SRC=ROOT/'src/server' def source(name):return (SRC/name).read_bytes().decode('latin1') il=source('common/item_length.h') assert il.index('ITEM_BELT,')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:' 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') assert '\t\tcase ITEM_NEW_RINGS:\t// AVA2 new rings\n' in items assert items.count('if (item2->GetAttributeSetIndex() == -1 && !item2->IsNewRing())')==3 assert items.count('if (item2->GetAttributeSetIndex() == -1)\n')==2 # 71051 / 71052 rare attributes stay closed attr=source('game/src/item_attribute.cpp') put=attr[attr.index('void CItem::PutAttributeWithLevel('):] assert put.index('PutNewRingAttributeWithLevel(bLevel);')