Jump to content
  • 0

Private store-Sell/buy need help


Question

5 answers to this question

Recommended Posts

  • 0
Posted

created it few days ago for l2jserver, GE. You can edit the currency of private store buy and private store sell (separately) in config

(l2jmod.properties)

Index: java/com/l2jserver/Config.java
===================================================================
--- java/com/l2jserver/Config.java	(revision 4410)
+++ java/com/l2jserver/Config.java	(working copy)
@@ -676,6 +676,8 @@
	public static String L2JMOD_MULTILANG_DEFAULT;
	public static boolean L2JMOD_MULTILANG_VOICED_ALLOW;
	public static boolean L2WALKER_PROTECTION;
+	public static int STORE_BUY_CURRENCY;
+	public static int STORE_SELL_CURRENCY;

	//--------------------------------------------------
	// NPC Settings
@@ -2285,6 +2287,8 @@
					L2JMOD_MULTILANG_VOICED_ALLOW = Boolean.parseBoolean(L2JModSettings.getProperty("MultiLangVoiceCommand", "True"));

					L2WALKER_PROTECTION = Boolean.parseBoolean(L2JModSettings.getProperty("L2WalkerProtection", "False"));
+					STORE_BUY_CURRENCY = Integer.parseInt(L2JModSettings.getProperty("PrivateStoreBuyMoneda", "57"));
+					STORE_SELL_CURRENCY = Integer.parseInt(L2JModSettings.getProperty("PrivateStoreSellMoneda", "57"));
				}
				catch (Exception e)
				{
Index: java/com/l2jserver/gameserver/model/TradeList.java
===================================================================
--- java/com/l2jserver/gameserver/model/TradeList.java	(revision 4410)
+++ java/com/l2jserver/gameserver/model/TradeList.java	(working copy)
@@ -802,9 +802,10 @@
				slots++;
		}

-		if (totalPrice > playerInventory.getAdena())
+		if (totalPrice > player.getBuyStoreCurrency())
		{
-			player.sendPacket(new SystemMessage(SystemMessageId.YOU_NOT_ENOUGH_ADENA));
+			final String name = ItemTable.getInstance().getTemplate(Config.STORE_BUY_CURRENCY).getName();
+			player.sendMessage("You dont have enough "+name);
			return 1;
		}

@@ -823,12 +824,12 @@
		// Prepare inventory update packets
		final InventoryUpdate ownerIU = new InventoryUpdate();
		final InventoryUpdate playerIU = new InventoryUpdate();
-		
-		final L2ItemInstance adenaItem = playerInventory.getAdenaInstance();
-		playerInventory.reduceAdena("PrivateStore", totalPrice, player, _owner);
+		final int moneda = Config.STORE_BUY_CURRENCY;
+		final L2ItemInstance adenaItem = playerInventory.getItemByItemId(moneda);
+		player.destroyItemByItemId("PrivateStore", moneda, totalPrice, _owner, true);
		playerIU.addItem(adenaItem);
-		ownerInventory.addAdena("PrivateStore", totalPrice, _owner, player);
-		ownerIU.addItem(ownerInventory.getAdenaInstance());
+		ownerInventory.addItem("PrivateStore", moneda, totalPrice, _owner, player);
+		ownerIU.addItem(ownerInventory.getItemByItemId(moneda));

		boolean ok = true;

@@ -965,7 +966,7 @@
				break;
			}

-			if (ownerInventory.getAdena() < _totalPrice)
+			if (_owner.getSellStoreCurrency() < _totalPrice)
				continue;

			// Check if requested item is available for manipulation
@@ -1043,11 +1044,12 @@
			if (totalPrice > ownerInventory.getAdena())
				// should not happens, just a precaution
				return false;
-			final L2ItemInstance adenaItem = ownerInventory.getAdenaInstance();
-			ownerInventory.reduceAdena("PrivateStore", totalPrice, _owner, player);
+			final int moneda = Config.STORE_SELL_CURRENCY;
+			final L2ItemInstance adenaItem = ownerInventory.getItemByItemId(moneda);
+			ownerInventory.destroyItemByItemId("PrivateStore", moneda, totalPrice, _owner, player);
			ownerIU.addItem(adenaItem);
-			playerInventory.addAdena("PrivateStore", totalPrice, player, _owner);
-			playerIU.addItem(playerInventory.getAdenaInstance());
+			playerInventory.addItem("PrivateStore", moneda, totalPrice, player, _owner);
+			playerIU.addItem(playerInventory.getItemByItemId(moneda));
		}

		if (ok)
Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java	(revision 4410)
+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -14889,4 +14889,18 @@
			addSkill(SkillTable.getInstance().getInfo(id, nextLevel), true);
		}
	}
+	
+	public synchronized long getBuyStoreCurrency()
+	{
+		L2ItemInstance item = this.getInventory().getItemByItemId(Config.STORE_BUY_CURRENCY);
+		
+		return item == null? 0 : item.getCount();
+	}
+	
+	public synchronized long getSellStoreCurrency()
+	{
+		L2ItemInstance item = this.getInventory().getItemByItemId(Config.STORE_SELL_CURRENCY);
+		
+		return item == null? 0 : item.getCount();
+	}
}
Index: java/com/l2jserver/gameserver/model/itemcontainer/PcInventory.java
===================================================================
--- java/com/l2jserver/gameserver/model/itemcontainer/PcInventory.java	(revision 4410)
+++ java/com/l2jserver/gameserver/model/itemcontainer/PcInventory.java	(working copy)
@@ -85,11 +85,14 @@
		FastList<L2ItemInstance> list = FastList.newInstance();
		for (L2ItemInstance item : _items)
		{
-			if ((!allowAdena && item.getItemId() == 57))
+			final int itemId = item.getItemId();
+			if ((!allowAdena && itemId == 57))
				continue;
-			if ((!allowAncientAdena && item.getItemId() == 5575))
+			if ((!allowAncientAdena && itemId == 5575))
				continue;
-
+			if(itemId == Config.STORE_BUY_CURRENCY)
+				continue;
+			
			boolean isDuplicate = false;
			for (L2ItemInstance litem : list)
			{
Index: java/com/l2jserver/gameserver/network/clientpackets/SetPrivateStoreListBuy.java
===================================================================
--- java/com/l2jserver/gameserver/network/clientpackets/SetPrivateStoreListBuy.java	(revision 4410)
+++ java/com/l2jserver/gameserver/network/clientpackets/SetPrivateStoreListBuy.java	(working copy)
@@ -140,7 +140,7 @@
		}

		// Check for available funds
-		if (totalCost > player.getAdena())
+		if (totalCost > player.getBuyStoreCurrency())
		{
			player.sendPacket(new PrivateStoreManageListBuy(player));
			player.sendPacket(new SystemMessage(SystemMessageId.THE_PURCHASE_PRICE_IS_HIGHER_THAN_MONEY));
Index: java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreListBuy.java
===================================================================
--- java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreListBuy.java	(revision 4410)
+++ java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreListBuy.java	(working copy)
@@ -33,7 +33,7 @@
	public PrivateStoreListBuy(L2PcInstance player, L2PcInstance storePlayer)
	{
		_objId = storePlayer.getObjectId();
-		_playerAdena = player.getAdena();
+		_playerAdena = player.getBuyStoreCurrency();
		storePlayer.getSellList().updateItems(); // Update SellList for case inventory content has changed
		_items = storePlayer.getBuyList().getAvailableItems(player.getInventory());
	}
Index: java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreListSell.java
===================================================================
--- java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreListSell.java	(revision 4410)
+++ java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreListSell.java	(working copy)
@@ -34,7 +34,7 @@
	public PrivateStoreListSell(L2PcInstance player, L2PcInstance storePlayer)
	{
		_objId = storePlayer.getObjectId();
-		_playerAdena = player.getAdena();
+		_playerAdena = player.getSellStoreCurrency();
		_items = storePlayer.getSellList().getItems();
		_packageSale = storePlayer.getSellList().isPackaged();
	}
Index: java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreManageListBuy.java
===================================================================
--- java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreManageListBuy.java	(revision 4410)
+++ java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreManageListBuy.java	(working copy)
@@ -34,7 +34,7 @@
	public PrivateStoreManageListBuy(L2PcInstance player)
	{
		_objId = player.getObjectId();
-		_playerAdena = player.getAdena();
+		_playerAdena = player.getBuyStoreCurrency();
		_itemList = player.getInventory().getUniqueItems(false, true);
		_buyList = player.getBuyList().getItems();
	}
Index: java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreManageListSell.java
===================================================================
--- java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreManageListSell.java	(revision 4410)
+++ java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreManageListSell.java	(working copy)
@@ -42,7 +42,7 @@
	public PrivateStoreManageListSell(L2PcInstance player, boolean isPackageSale)
	{
		_objId = player.getObjectId();
-		_playerAdena = player.getAdena();
+		_playerAdena = player.getSellStoreCurrency();
		player.getSellList().updateItems();
		_packageSale = isPackageSale;
		_itemList = player.getInventory().getAvailableItems(player.getSellList());
Index: java/config/l2jmods.properties
===================================================================
--- java/config/l2jmods.properties	(revision 4410)
+++ java/config/l2jmods.properties	(working copy)
@@ -379,3 +379,14 @@
# Basic protection against L2Walker.
# Default: False
L2WalkerProtection = False
+
+# ---------------------------------------------------------------------------
+# Private Store Buy/Sell - Moneda de cambio
+# ---------------------------------------------------------------------------
+# Elige que moneda quieres que se use como pago en los Private Store Buy (amarillos)
+# Retail: 57, Por Defecto: 57
+PrivateStoreBuyMoneda = 57
+
+# Elige que moneda quieres que se use como pago en los Private Store Sell (morados)
+# Retail: 57, Por Defecto: 57
+PrivateStoreSellMoneda = 57

Guest
This topic is now closed to further replies.


  • Posts

    • I have a highly customized Hi5 pack based on L2JMobius with a lot of features for performance and modern game design. Disclaimer: I do not run any public server, but I run a "private" server for a group of 10 friends and about 2000 AI bots that required me to do heavy modifications on core systems of the game.  So my opinion will obivously be biased towards L2JMobius.   What I can tell you though without bias is: Most of the features you are asking for are nowadays considered de-facto, don't pay money for them. TvT, offline mode, community boards, premiums, vote rewards are in most packs including the open source ones. So before you pay a thousand plus euro for a pack ask yourself what you are paying that money for, that open source packs don't have.   Also a lot of the "strong points" some old packs were made for are nowadays obsolete. L2JFree derived packs for example used to have a lot of GC optimizations (Trove library) which are not not maintained, but most importantly not needed cause Java has evolved a lot since then and the performance issues these tricks tried to solve back then, are currently solved by Java's JVM itself. So if someone tries to sell you packed / unpacked integers in special hashmap data structures and other such things know that they have really lost their value nowadays.    A lot of people are selling thin air, things that everyone has. "Quality geodata" being one of them. I mean what's "quality geodata" ? Has someone painted them by hand ? Hell there's an online tool for free in github that extracts quality geodata, I think Galagard made it ? In contrast I'll tell you without wanting to boast about it that I use 3D navmesh on my project because 2000 bots could not pathfind large distances on A* on geodata. As far as I know, L2JMobius has it in its subscription version too. So if I could do an acceptable transition to navmesh from geodata in a week alone, I would assume that a decent pack with dedicated developers could do it better and faster. Red flag if someone still tries to sell you geodata in 2026.   Multi-protocol support gives small value and is a high risk.   I would not go for multi-protocol support for a public server cause you are locking yourself to specific providers and the functionality they support. If you need to change (eg pricing issues), you will be locked to a handful of providers. And what are you really gaining from a new client on an old game version ? Better UI ? The engine is still the same, static targeting and menus.    Agentic AI will make old hard features easy to implement, and drop their money value. Pay for AI-proof value. And compared to what most insecure devs claim, its a very powerful tool that allows those who know how to use it to accelerate their development. So a lot of features that took in the past a lot of time and effort to be developed and were a reason to charge money, are becoming a commodity today. So think to: The thing I am paying money for right now, how easy will it be to implement in a year from now ? If for example you are paying money for a game launcher that Claude Code can generate in top 1 hour without issues, I think you are wasting money.    I want to emphasise this a lot. Software engineering is in a transition atm. Most things that were mediocre to implement, launchers, guards, CMS, are nowadays easy. Yet the dev community continues to market them as premium content. They are not, sooner or later, when everyone starts selling them, they will realize that they will have to offer value in more complex features.  Private or public ? Bottom line is that a private pack and 1000 euro wont get you a sucessful server. You're the one that make it or break it. There have been many sucessful servers both in private packs and public packs in the past. It's really on the hands of the beholder, not on the source. A pack that plays good is a good indicator to buy as Trance said, but I would disagree that it's not enough. A server owner is not a player. He's a business man and has to account for longevity, vendor lock-in, expandability, hidden costs,  amortization, price changes and many more. Don't pick a pack based on how it played only.    
    • You don’t even need to look for a ghost project. Just buy the files from a project you’ve personally tested or played. That’s a much better starting point.
    • TG Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server!  Create your free account here
    • You have to put deep inside your pocket for something like this, for sure 😄
    • Hello everyone, I'm looking for a High Five Java server pack for a long-term project. I'm not looking for free packs. I'm interested in purchasing a professional pack with full source code if it's worth the investment. My priorities are: Stable core Clean and well-structured source code Good geodata and AI Modern Community Board Offline Trade / Offline Craft Premium Account system Vote Reward system Auto Events (TvT, CTF, DM, etc.) HWID protection Auto Farm  Buffer / QoL systems Modern admin tools Good Olympiad & Seven Signs implementation Excellent instance support (Freya, Frintezza, Zaken, Beleth, etc.) A huge bonus would be: Multi-protocol support (High Five + newer clients such as Salvation/Classical clients) Full source code (no closed binaries) Some custom things over Elegia At the moment I'm considering packs like Sunrise and L2-Scripts, but I'd really like to hear opinions from people who have actually worked with them. If you've been running a serious High Five project, I'd appreciate your honest feedback: Which pack are you using? What are its strengths and weaknesses? Would you buy it again? Are there any better alternatives available today? I'm looking for real experience rather than advertisements. Thanks!
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..