Jump to content
  • 0

Help acis sell on the community board


Question

Posted

I did it like this.

else if (command.startsWith("_bbssell"))
        {
            player.sendPacket(new SellList(player));
        }

A sales window opens but doesn't sell stuff,
and if you come up to any nps, L2Merchant sells.
How to do not need a npc?

7 answers to this question

Recommended Posts

  • 0
Posted (edited)
2 hours ago, la2betdrema said:

I guess I have to dig into RequestSellItem, but I can't figure out where...

 

Quote

final Npc merchant = (player.getTarget() instanceof Merchant || player.getTarget() instanceof MercenaryManagerNpc) ? (Npc) player.getTarget() : null;
if (merchant == null || !merchant.canInteract(player))
   return;


If you remove this condition, the sale will work, but this is not the right decision.
It is better to consider when we sell through NPCs, and when through CommunityBroad.

Edited by gvb
  • 0
Posted

You need add new variable into Player instance for emulate fake merchant for community and manage this variable before calling sell/buy list and by max allowed interaction time.

  • 0
Posted
final Npc merchant = (player.getTarget() instanceof Merchant || player.getTarget() instanceof MercenaryManagerNpc) ? (Npc) player.getTarget() : null;
if (merchant == null || !merchant.canInteract(player))
   return;

I'm sorry, but this condition is not working. ((

  • 0
Posted (edited)

I made a sale. 

 

CommynityBoard.java

else if (command.startsWith("_bbssell"))
        {
            player.setIsBBSUse(true);
            player.sendPacket(new SellList(player));
        }


 

Player.java

private boolean is_bbs_use = false;

public void setIsBBSUse(boolean value)
	{
		is_bbs_use = value;
	}

	public boolean isBBSUse()
	{
		return is_bbs_use;
	}

 

RequestSellItem.java

 

Replace this.

if (merchant == null || !merchant.canInteract(player))
			return;

using this

if ( !player.isBBSUse() && ( merchant == null  || !merchant.canInteract( player ) ) )
			return;

Just one more question. How to make this function player.setIsBBSUse(true) change to player.setIsBBSUse(false)
Could be a problem, I guess.

Edited by la2betdrema
Guest
This topic is now closed to further replies.
×
×
  • Create New...