AVA2 unlock P6: costume enchants (USE_CHANGE_ATTRIBUTE 54001-54267)

Enchant stones add one fixed attribute to an unequipped body / hair /
mount-skin costume (max 3, no duplicates); gear and the switchbot refuse
them. MTCATTR chat commands report the result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-16 14:12:30 +09:00
co-authored by Claude Opus 5.5
parent fb066e7046
commit 6199b2cbff
9 changed files with 164 additions and 2 deletions
+4
View File
@@ -45,6 +45,7 @@ class CHARACTER;
class CItem {public:
DWORD id,vnum;BYTE type,subtype;int set=0;unsigned cell;BYTE window=INVENTORY;bool equipped=false,exchanging=false;int count=1;
CHARACTER* owner=nullptr;TItemTable proto{};TPlayerItemAttribute attrs[7];
long value2=0;bool IsCostumeEnchant(){return vnum>=54001 && vnum<=54267 && value2;}
DWORD GetID(){return id;}DWORD GetVnum(){return vnum;}BYTE GetType(){return type;}BYTE GetSubType(){return subtype;}
int GetAttributeSetIndex(){return set;}const TItemTable* GetProto(){return &proto;}
const TPlayerItemAttribute& GetAttribute(int i){return attrs[i];}BYTE GetAttributeType(int i){return attrs[i].bType;}
@@ -131,6 +132,9 @@ int main(){
cmd("1 start 10 71084 5 2 3 1 3 2");assert(last()=="MTSB1 error start target"); // duplicate
cmd("1 start 10 71085 5 1 3 4");assert(last()=="MTSB1 error start scroll");
cmd("1 start 10 50001 5 1 3 4");assert(last()=="MTSB1 error start scroll");
// AVA2 costume enchants share USE_CHANGE_ATTRIBUTE but are no switchers (port_costume_attr.cpp).
CItem enchant{2004,54001,ITEM_USE,USE_CHANGE_ATTRIBUTE,-1,23};enchant.owner=&ch;enchant.value2=2;ch.inventory.push_back(&enchant);
cmd("1 start 10 54001 5 1 3 4");assert(last()=="MTSB1 error start scroll");
cmd("1 start 30 71084 5 1 3 4");assert(last()=="MTSB1 error start no_attr");
armor.equipped=true;cmd("1 start 10 71084 5 1 3 4");assert(last()=="MTSB1 error start equipped");armor.equipped=false;
cmd("1 start 10 71084 5 1 3 2");assert(last()=="MTSB1 state 0 10 11209 0 5 71084 3 matched" && events.empty()); // already satisfied