Hello
I'm trying to make this refine item only for item_weapon and another refine item only for item_armor, another only for metin, etc..
I tried something like this but it's not working, the item 71301 should only work for weapon but when i use it on a weapon or another item it always says the message "error_refine_only_weapon"
Do you know where is the mistake of my code?
Code
- case USE_TUNING:
- case USE_DETACHMENT:
- {
- LPITEM item2;
- switch (item->GetVnum())
- {
- case 71301:
- if (item2->GetType() != ITEM_WEAPON)
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("error_refine_only_weapon"));
- return false;
- }
- break;
- case 71302:
- if (item2->GetSubType() != ARMOR_BODY)
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("error_refine_only_armor"));
- return false;
- }
- break;
- case 71303:
- if (item2->GetType() != ARMOR_METIN)
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("error_refine_only_armor"));
- return false;
- }
- break;
- }
- if (!IsValidItemPosition(DestCell) || !(item2 = GetItem(DestCell)))
- return false;
- if (item2->IsExchanging() || item2->IsEquipped()) // @fixme114
- return false;
- #ifdef ENABLE_ACCE_SYSTEM
- if (item->GetValue(0) == ACCE_CLEAN_ATTR_VALUE0)
- {
- if (!CleanAcceAttr(item, item2))
- return false;
- return true;
- }
- #endif