Jump to content
  • 0

Check if signed item matches the character's


Venture

Question


  • Group:  Members
  • Topic Count:  52
  • Topics Per Day:  0.01
  • Content Count:  179
  • Reputation:   2
  • Joined:  08/30/13
  • Last Seen:  

Is there a way to check if signed item matches the character's?

I need the NPC to only accept if the item is produced by themselves.

Edited by Venture
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  52
  • Topics Per Day:  0.01
  • Content Count:  179
  • Reputation:   2
  • Joined:  08/30/13
  • Last Seen:  

I managed to get this to work:
 

function	script	HasOwnNamedItem	{
	.@itemID = getarg(0);
	.@charID = getarg(1);
	
	.@card3 = .@charID & 65535;
	.@card4 = .@charID >> 16;

	getinventorylist .@charID;

	for( .@i = 0; .@i < @inventorylist_count; .@i++ )
	{
		if(@inventorylist_id[.@i] == .@itemID && @inventorylist_card3[.@i] == .@card3 && @inventorylist_card4[.@i] == .@card4)
		{
			return true;
		}
	}

	return false;
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...