Jump to content
  • 0

Check if signed item matches the character's


Question

Posted (edited)

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

1 answer to this question

Recommended Posts

  • 0
Posted

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;
}

 

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...