Jump to content
  • 0

Gold Bars in Private Store (Buy/Sell)


Question

Posted

Hello, in some servers I have seen that private stores made by players use gold bars instead of adena as the currency. How can I do this? Is there a patch available?

8 answers to this question

Recommended Posts

  • 0
Posted

Hello, in some servers I have seen that private stores made by players use gold bars instead of adena as the currency. How can I do this? Is there a patch available?

Which client?

  • 0
Posted

I will be willing to pay someone to get this working.

 

dont worry, you dont have to buy anything, I will code it as soon as I go home, cause now Im from the phone

 

dont waste ur money ;)

  • 0
Posted

here is your code:

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/network/serverpackets/PrivateStoreListBuy.java
===================================================================
--- java/net/sf/l2j/gameserver/network/serverpackets/PrivateStoreListBuy.java	(revision 42)
+++ java/net/sf/l2j/gameserver/network/serverpackets/PrivateStoreListBuy.java	(working copy)
@@ -28,7 +28,7 @@
	{
		_storePlayer = storePlayer;
		_activeChar = player;
-		_playerAdena = _activeChar.getAdena();
+		_playerAdena = _activeChar.getInventory().getItemByItemId(3470)==null?0:_activeChar.getInventory().getItemByItemId(3470).getCount();
		_storePlayer.getSellList().updateItems(); // Update SellList for case inventory content has changed
		_items = _storePlayer.getBuyList().getAvailableItems(_activeChar.getInventory());
	}
### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/network/serverpackets/PrivateStoreListSell.java
===================================================================
--- java/net/sf/l2j/gameserver/network/serverpackets/PrivateStoreListSell.java	(revision 42)
+++ java/net/sf/l2j/gameserver/network/serverpackets/PrivateStoreListSell.java	(working copy)
@@ -30,7 +30,7 @@
	{
		_activeChar = player;
		_storePlayer = storePlayer;
-		_playerAdena = _activeChar.getAdena();
+		_playerAdena = _activeChar.getInventory().getItemByItemId(3470)==null?0:_activeChar.getInventory().getItemByItemId(3470).getCount();
		_items = _storePlayer.getSellList().getItems();
		_packageSale = _storePlayer.getSellList().isPackaged();
	}
### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/network/serverpackets/PrivateStoreManageListBuy.java
===================================================================
--- java/net/sf/l2j/gameserver/network/serverpackets/PrivateStoreManageListBuy.java	(revision 42)
+++ java/net/sf/l2j/gameserver/network/serverpackets/PrivateStoreManageListBuy.java	(working copy)
@@ -28,7 +28,7 @@
	public PrivateStoreManageListBuy(L2PcInstance player)
	{
		_objId = player.getObjectId();
-		_playerAdena = player.getAdena();
+		_playerAdena = player.getInventory().getItemByItemId(3470)==null?0:player.getInventory().getItemByItemId(3470).getCount();
		_itemList = player.getInventory().getUniqueItems(false, true);
		_buyList = player.getBuyList().getItems();
	}
### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/network/serverpackets/PrivateStoreManageListSell.java
===================================================================
--- java/net/sf/l2j/gameserver/network/serverpackets/PrivateStoreManageListSell.java	(revision 42)
+++ java/net/sf/l2j/gameserver/network/serverpackets/PrivateStoreManageListSell.java	(working copy)
@@ -31,7 +31,7 @@
	public PrivateStoreManageListSell(L2PcInstance player, boolean isPackageSale)
	{
		_objId = player.getObjectId();
-		_playerAdena = player.getAdena();
+		_playerAdena = player.getInventory().getItemByItemId(3470)==null?0:player.getInventory().getItemByItemId(3470).getCount();
		player.getSellList().updateItems();
		_packageSale = isPackageSale;
		_itemList = player.getInventory().getAvailableItems(player.getSellList());
### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/model/TradeList.java
===================================================================
--- java/net/sf/l2j/gameserver/model/TradeList.java	(revision 42)
+++ java/net/sf/l2j/gameserver/model/TradeList.java	(working copy)
@@ -759,10 +759,10 @@
			else if (playerInventory.getItemByItemId(item.getItemId()) == null)
				slots++;
		}
-		
-		if (totalPrice > playerInventory.getAdena())
+		int gbcount=playerInventory.getItemByItemId(3470)==null?0:playerInventory.getItemByItemId(3470).getCount();
+		if (totalPrice > gbcount)
		{
-			player.sendPacket(SystemMessageId.YOU_NOT_ENOUGH_ADENA);
+			player.sendMessage("Incorrect item count");
			return 1;
		}

@@ -782,15 +782,11 @@
		final InventoryUpdate ownerIU = new InventoryUpdate();
		final InventoryUpdate playerIU = new InventoryUpdate();

-		final L2ItemInstance adenaItem = playerInventory.getAdenaInstance();
-		if (!playerInventory.reduceAdena("PrivateStore", totalPrice, player, _owner))
-		{
-			player.sendPacket(SystemMessageId.YOU_NOT_ENOUGH_ADENA);
-			return 1;
-		}
+		final L2ItemInstance adenaItem = playerInventory.getItemByItemId(3470);

		playerIU.addItem(adenaItem);
-		ownerInventory.addAdena("PrivateStore", totalPrice, _owner, player);
+		ownerInventory.addItem("PrivateStore", 3470, totalPrice, player, null);
+		ownerInventory.destroyItem("PrivateStore", adenaItem, totalPrice, player, null);

		boolean ok = true;

@@ -932,7 +928,7 @@
				break;
			}

-			if (ownerInventory.getAdena() < _totalPrice)
+			if (ownerInventory.getItemByItemId(3470).getCount() < _totalPrice)
				continue;

			// TODO: eventually test and fix this.
@@ -1015,15 +1011,16 @@
		// Transfer adena
		if (totalPrice > 0)
		{
-			if (totalPrice > ownerInventory.getAdena())
+			int gbcount=ownerInventory.getItemByItemId(3470)==null?0:playerInventory.getItemByItemId(3470).getCount();
+			if (totalPrice > gbcount)
				return false;

-			final L2ItemInstance adenaItem = ownerInventory.getAdenaInstance();
-			ownerInventory.reduceAdena("PrivateStore", totalPrice, _owner, player);
+			final L2ItemInstance adenaItem = ownerInventory.getItemByItemId(3470);
+			playerInventory.destroyItem("PrivateStore", adenaItem, totalPrice, _owner, null);
			ownerIU.addItem(adenaItem);

-			playerInventory.addAdena("PrivateStore", totalPrice, player, _owner);
-			playerIU.addItem(playerInventory.getAdenaInstance());
+			ownerInventory.addItem("PrivateStore", 3470, totalPrice, player, null);
+			playerIU.addItem(playerInventory.getItemByItemId(3470));
		}

		if (ok)

 

Its handwritten and not tested, but im 95% sure that you wont have any problems

 

PS: Coded on aCis (it will be very similar with freya since aCis is based on freya)

PS2: I used the Gold Bar 3470 as ID, feel free to change it with replace all ;)

 

PS3: Dont test on live server ;D

Guest
This topic is now closed to further replies.


  • Posts

    • Google Ads Accounts — a tool for scaling advertising Google Ads is one of the most effective advertising platforms in the world. Google Ads accounts allow you to: — promote products and services through Google search; — launch targeted advertising in different countries; — attract new customers and increase sales; — set up campaigns for specific goals: traffic, leads, conversions; — optimize expenses and control advertising performance. Having Google Ads accounts provides access to a wide audience and helps maximize the potential of the Google advertising network. Our store’s assortment of Google Ads accounts includes: Google Ads Account USA/EUROPE (UK, Germany, France, etc.) | Manually farmed 7+ days | Created ad account | Includes 2FA, backup codes, backup email, UserAgent, Cookies | Price from: $13.00 Google Ads Account USA/EUROPE | VERIFICATION COMPLETED – €10 BILL | Manually farmed 7+ days | Ad created | Includes 2FA, backup email, UserAgent, Cookies | Price from: $55.00 Google Ads Account EUROPE/USA with ad campaigns and spend $100/$500/$1000+ | Verification not completed | Full access & setup | Price from: $200.00 Google Ads Account EUROPE/USA with ad campaigns and spend $100/$500/$1000+ | Verification completed | Full access & setup | Price from: $400.00 Current links: Digital goods store (Website): Go Telegram bot for purchasing Telegram Stars: Go SMM Panel: Go – promotion of your social media accounts. Store Telegram bot: Go Promotions and special offers: 1. Promo code SEPTEMBER2025 (10% discount) for purchases in our store (Website, bot) in September! You can also use the promo code for your first purchase: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10-20% discount, just write your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." – you need to post it in our forum thread! 3. Get $1 for your first trial run of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly giveaways of Telegram Stars in our Telegram channel and in our bot for purchasing stars! News resources: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n ➡ Discord server: https://discord.gg/y9AStFFsrh We are actively seeking suppliers for the following product categories: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via email/phone number — Reddit old accounts with post and comment karma from 100 to 100,000+ | Full access via email — LinkedIn old accounts with real connections | Geo: Europe/USA | Full access via email + active 2FA password — Instagram old accounts (2010-2023) | Full access via email (possibly with active 2FA password) — Facebook old accounts (2010-2023) | Full access via email (possibly with active 2FA password) | With or without friends | Geo: Europe/USA/Asia — Threads accounts | Full access via email (possibly with active 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts Contact us at the details below — let’s discuss the terms! We are always open to other partnership offers as well. Contacts and support: ➡ Telegram: https://t.me/socnet_support  ➡ WhatsApp: https://wa.me/79051904467  ➡ Discord: socnet_support  ➡ ✉ Email: solomonbog@socnet.store  Through these contacts you can also: — get consultation on wholesale purchases — establish a partnership (current partners: https://socnet.bgng.io/partners ) — become our supplier SocNet — store for digital goods and premium subscriptions 
    • try to remove this AI.obj or use it is functional https://www.mediafire.com/file/2g4d3o5hd0ca48o/ai.obj/file
    • Done. Thanks for your choose and trust us, we are the only and LAST, authentic L2OFF Service.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock