Jump to content
  • 0

Wear (ShopPreviewList) at Community Board - HELP


Question

Posted

Hello friends, I am working on a personal project L2j Homunculus. After several days trying to run an appearance tester for the CB, I go to consult here.

 

I'm using the base of the "wear" command from some old NPCs, but somewhat reduced.

 

	if (command.equals("_bbsequipment"))
	{
		player.sendPacket(new ShopPreviewList(BuyListData.getInstance().getBuyList(3013500), player.getAdena()));
	}

 

After configuring the buttons, it opens the window with the items that I want to try but when I want to buy them, it does not give me the item or any message in the game, but in the Gameserver console it announces "null merchant".

 

Community Board - Services

Window for test

Shop Preview Window

Console Announcement

 

Could someone give me a hand? Thank you.

4 answers to this question

Recommended Posts

  • 0
Posted (edited)
4 hours ago, SOWH2 said:

Thanks for taking the time to respond, Kara, is what I envisioned. I'm new to this, would you give me a nudge with some way to bypass NPC verification? Anyway, thank you very much, have a nice day.

 

First of all you have to dig the messages in console to understand which java file has the "problem". An example can be the following:

 

Search for L2Buylist in your project and you locate what files are using this class. 

For example in RequestBuyItem.java you can find the following check:

 

if (!player.isGM())
{
	if (!(target instanceof L2MerchantInstance) || !player.isInsideRadius(target, INTERACTION_DISTANCE, true, false) || player.getInstanceId() != target.getInstanceId())
	{
		sendPacket(ActionFailed.STATIC_PACKET);
		return;
	}

	merchant = (L2Character) target;
}

 

This can stop your code since there is no merchant around you to buy item. It might have more checks

(Consider these are from L2JServer, i don't bother work or check amateur trash packs such as Mythras, Scripts e.t.c.)

 

PS. You can also join my discord's community. It's mostly for clients but i have also people from MAXC.

 

 

Check in my topic you will find the invitation link

Edited by Kara
  • Like 1
  • 0
Posted
14 minutes ago, SOWH2 said:

Hello friends, I am working on a personal project L2j Homunculus. After several days trying to run an appearance tester for the CB, I go to consult here.

 

I'm using the base of the "wear" command from some old NPCs, but somewhat reduced.

 


	if (command.equals("_bbsequipment"))
	{
		player.sendPacket(new ShopPreviewList(BuyListData.getInstance().getBuyList(3013500), player.getAdena()));
	}

 

After configuring the buttons, it opens the window with the items that I want to try but when I want to buy them, it does not give me the item or any message in the game, but in the Gameserver console it announces "null merchant".

 

Community Board - Services

Window for test

Shop Preview Window

Console Announcement

 

Could someone give me a hand? Thank you.

 

Buylist require NPC which is defined inside the SQL along with the buylist id.

Upon your click code check that there is no NPC hence the message you get.

 

You need dig into the BuyListData and their code and make a new method which ignore the npcID check. 

  • 0
Posted
1 hour ago, Kara said:

 

Buylist require NPC which is defined inside the SQL along with the buylist id.

Upon your click code check that there is no NPC hence the message you get.

 

You need dig into the BuyListData and their code and make a new method which ignore the npcID check. 

Thanks for taking the time to respond, Kara, is what I envisioned. I'm new to this, would you give me a nudge with some way to bypass NPC verification? Anyway, thank you very much, have a nice day.

  • 0
Posted (edited)

 

4 hours ago, Kara said:

 

First of all you have to dig the messages in console to understand which java file has the "problem". An example can be the following:

 

Search for L2Buylist in your project and you locate what files are using this class. 

For example in RequestBuyItem.java you can find the following check:

 



if (!player.isGM())
{
	if (!(target instanceof L2MerchantInstance) || !player.isInsideRadius(target, INTERACTION_DISTANCE, true, false) || player.getInstanceId() != target.getInstanceId())
	{
		sendPacket(ActionFailed.STATIC_PACKET);
		return;
	}

	merchant = (L2Character) target;
}

 

This can stop your code since there is no merchant around you to buy item. It might have more checks

(Consider these are from L2JServer, i don't bother work or check amateur trash packs such as Mythras, Scripts e.t.c.)

 

PS. You can also join my discord's community. It's mostly for clients but i have also people from MAXC.

 

 

Check in my topic you will find the invitation link

Thanks Kara, I'm going to enter the discord. Greetings.

Edited by SOWH2
Guest
This topic is now closed to further replies.


×
×
  • Create New...