Hello I am writing this topic because honestly I'm out of ideas on how I could approach the issue I am facing hence I am not too experimented in C++ nor metin2 source behavior
I wanted to make an item which could be put on an armor/weapon and the item should've, once consumed, 1. to disappear from the inventory and 2. to change the rarity of the item
I saw that an item which could be put on another item and inflict such a change was the 71084(change attr) and then I followed along and in
item_attribute.cpp:
void CItem::ChangeRarity(item, int rarity)
{
int iRarity = rarity;
item->SetSocket(RARITY_ITEM_SOCKET, iRarity);
ChatPacket(CHAT_TYPE_INFO, "<Rarity> Rarity changed.");
}
item.h obviously:
void ChangeRarity();
char_item.cpp:
case USE_RARITY:
LPITEM item2;
if (item -> GetVnum(30526))
{
ChangeRarity(item2, 5);
}
item->SetCount(item->GetCount() - 1)
break;
I've set in item_proto the type and subtype accordingly item_use and use_rarity but the behavior in-game is what I don't understand. I put the item(30526) on an armor and nothing happens with both of them. However, I can right click on 30526 and the item dissapears from the inventory, so my function is wrongly written and doesn't work when I put 30526 on items?
Thanks in advance for any help regarding my little issue!