Hello guys,
I need some help. I want to create an item which has two functionalities:
1. you can drag the item to another item (named item2) to interact with item2 (e.g. change bonus of the item2)
2. you can right click (means use) the item and receive anything (like a treasure or sth)
At the moment I got this idea:
case USE_NEW_ITEM:
{
LPITEM item2;
if (!IsValidItemPosition(DestCell))
return false;
if (!(item2 = GetItem(DestCell))) { //item right clicked
if (test_server) ChatPacket(CHAT_TYPE_INFO, "item used");
}
else { //item dropped to pet seal
if (!item2) return false;
if (item2->IsExchanging() || item2->IsEquipped())
return false;
if (test_server) ChatPacket(CHAT_TYPE_INFO, "item dragged");
}
break;
}
With this code only the dragging works but the using (rightclicking) does not.
Do you know anything I could change?
solved myself: the problem was that I tried to check
if (!IsValidItemPosition(DestCell))
return false;
before making sure I really drag the item on another item