Jump to content
  • 0
Sign in to follow this  

open Give 2 use cases to a TYPE_USE subtype (drag and right click)


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");


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

Share this post

Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.