Jump to content
  • 0

Help acis sell on the community board


la2betdrema

Question

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?

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0
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
Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0
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. ((

Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • rename the l2.bin into l2.exe
    • L2LIVE.PRO- Dynamic Mid-rates Essence Seven Signs GRAND OPENING - July 5, 20:00 GMT+3 (EEST) TEST SERVER IS OPEN - COME AND CHECK IT OUT TODAY! Join our community and be part of it at: https://www.l2live.pro https://discord.gg/k3NMgR4Dmu   Server description * EXP/SP: Dynamic (x1- x100 based on your level, *before* Sayha and EXP buffs * Adena: x50 / Item Drop: x10 / Fishing EXP increased / Attribute EXP increased * Simplified gameplay to stay in the loop while not spending hours and hours farming * Starter Pack containing very useful items for beginners * MP replenishing potions with auto-consumption * No overpowered donations L2LIVE shop * All spellbook coupons, pet spellbook coupons and master books are sold via Game Assistant * Additionally you can buy SP pouches, enchanted talismans, pet training guides and various other consumables for Adena and L-Coin * More items such as cloaks, more talismans, agathions, belts, pendants, enchantment scrolls of various grades, evolution stones, etc will be added! Shop server as a shortcut, and all retail-like ways of earning items are still here! L-Coins * Drops with small change and in random amounts from Lv60+ monsters  * All raidbosses drop random amount of L-Coin Pouches generating up to 420 Lcoin per unit. **Grand Olympiad and Events** * Grand Olympiad is held week day * Format is 1v1, unlimited weekly fights  * Heroes are declared weekly at Sunday * There are three automated events - TvT, CTF and Deathmatch, running at evenings * Orc Fortress, Battle with Balok, Keber Hunter, Archievements Box, Daily Gift Calendar provisional events are active too Custom user commands * .offlineplay command, your character will keep playing till death or server restart * .offlineshop command, keeps your shop sitting until all items are purchased * .apon / .apoff - enable/disable HP/MP autoconsume And lots of other small improvements are waiting for you!   Join our community and be part of it at: https://www.l2live.pro https://discord.gg/k3NMgR4Dmu
  • Topics

×
×
  • Create New...