Jump to content
  • 0

[HELP] Change Private Shop Adena To Custom?


Question

10 answers to this question

Recommended Posts

  • 0
Posted

i think this is very hard work, you will need to change in all PrivateStores packet adena to your custom item

 

so u at least give and hint how start this "hard work"?

  • 0
Posted

Is not so hard my friend you haft to add 1 path and compile again your server.

This path

 

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • L2jBayev Chronicle 3: Rise of Darkness – AiEngine Edition In short: this is a C3 build with a full-fledged AI engine, live mercenaries, a built-in quiz, a “personal account” in the Community Board, and server logic neatly distributed across thread pools. The project is about a living world without lags : bots farm, communicate, gather parties, teleport along routes, and the server remains cold and stable.   What's inside (the most delicious) 1) Full-fledged AI engine for characters Behavior types: farming ( FarmAI ), combat ( CombatAI ), party logic ( PartyAI ), trading/walking ( TraderAI / WalkerAI ), support roles (healer, etc.). Class profiles: for mages/archers/daggers, etc., “smart” skill rotations, distance control, sleep/save skills, healing, loot pickup, etc. are implemented (see examples of classes like SpellSingerAI , NecromancerAI , etc.). Self-healing and teleports: when dying, the bot goes through a sequence of steps without sleep()- via AITaskSequence + AITeleportToLocTask , searches for the nearest gatekeeper and teleports via TeleportationManager with routes depending on the level. Auto-support: auto-nipples, arrows/bones, smart auto-proceduring of buffs and auto-banks CP/HP/MP with thresholds - all sewn into the auxiliary EtcPlayersAi . Chat context: ChatManagerAi processes mentions, makes responses with delays (anti-flood), supports party chat and “human” reaction. Understanding: ChatManagerAi system  processes the dialogue, bots remember your aggression and insults, they start to respond less often to modern users, stop accepting or inviting to a group (party) and when it goes beyond the peak they will simply merge you, and every time they see you on the PC, there is an opportunity to measure more often, communicate respectfully and beautifully, in general, a “human” reaction. Why a player/admin needs this: bots actually “live”, farm and interact, and don’t just stand on macros. This is a great background for online and PvE action.   2) Mercenaries (Mercenary system) Full-fledged companion character : L2MercenaryInstance with its own MercenaryAI (movement, attack, support, consumables, shots). Behavior modes: DEFENDER / SUPPORT / PASSIVE - switchable to suit your playing style. Progress and trust: the mercenary's trust/exp/level grows , skills are learned according to the MercenarySkillTree (conditions are based on the trust or level of the owner). Templates and equipment: via MercenaryTemplateTable and spawner - model/weapon/type are selected. Social: MercenarySpeechManager - a set of speeches; the mercenary "comes to life" in the chat. Premium Link: Premium account owners give the mercenary additional trust (faster progress). Why: This is not a dummy pet, but a playful companion with modes, training and “character”.   3) Quiz (event viktorina ) Rounds according to schedule: pre-launch with announcements (minutes/seconds before start), registration .reg, auto-opening of the window. Multiple choice questions: question + set of answer buttons; fair processing, timings, question change. Tops and history: results table, statistics, neat UI via HTML assembly. Flexible control: you can start immediately or set a delayed start (notification package 5/2/1 min, etc.). Why: regular activity for players, “social entertainment” module right in the build.   4) Personal account in Community Board KB managers: buff cabinet, teleports, clans/forums/mail/friends, tops (PK/PvP/wealth/players), character repair, viewing skill trees , etc. Premium logic: some services/mail are limited by premium; premium also affects the visual (nickname color) and bonuses (see effect on mercenary). Single sign-on: all in one place, no team chaos. Why: conveniently manage your character and services without going into the console or installing third-party mods.   Why is the system technically valuable? Minimum load and stability Separated thread pools: AI logic, hunting, teleports, chat - on separate onesScheduledExecutorService ( AI_THREAD_POOL , MONSTER_HUNT_POOL , TELEPORT_POOL , CHAT_POOL ). No "freezing": task sequencers (teleport/recovery) work through the scheduler, not Thread.sleep(). Bot limitation: protection against overload via thresholds/counters - “extra” bots do not start. One bot - one sequence: AITaskManager ensures that the character does not have parallel conflicting tasks. Smoothing out peaks: starting tasks with offsets so that there are no simultaneous “ticks” of hundreds of bots. Monitoring/logs: own loggers (separate files for info/errors/processes/chats), CPU load monitoring. Bottom line: the build is designed for “thick online” and mass activities without TPS failures .   Additional Features Auto-alliances for farming: party logic invites suitable players (checking level/equipment/clan flags), there are “human” responses to requests. Sub/class management: out of the box helpers for changing class/subclass, auto-learning of necessary skills and selection of equipment by level. Security/protection: secondary PIN/picture password support (used in KB/voiced commands; optional). Premium accounts: privileges in KB/mail/visual and synergy with mercenary progress. Ready-made services: tops, auctions/mail, teleports from KB, buff rooms, repairs, viewing skill trees, etc.   Who is this build for? Freeshare/project admins who want a living world “from the pack”: bots and mercenaries provide a constant background of activity. Players who value convenience: personal account, premium services, events and a mercenary companion. Developers who want a clean, predictable backend with thread pools and a neat task model without “magic”.   How it differs from standard assemblies Not macros - AI profiles with “brains”: rotations, positioning, healing, decision making. Not a decoration pet - a mercenary with his own modes, progress, skill tree and lines. Not a faceless gamemod - an event quiz with UI, schedule, tops. No chaos in flows - strict pools, planning and task managers designed for online and growth. No separate scripts - a single personal account in KB for most activities.   TL;DR (one paragraph for the project card) AiEngine C3 is a build with live AI, smart bots, mercenaries (modes/progress/skills), built-in quiz, premium logic and a convenient personal account in KB. Under the hood are distributed thread pools and task managers without sleep(), so even with a dense online the server remains stable and responsive.   Additionally add - there is still a lot of interesting things command .assassin or shift+target (order murder), shift+target for admins on AI characters for control, admin panel is completely rewritten, many additional functions, mercenaries change their appearance depending on trust, deepseek and chatGPT system is connected for communication of characters like real players, GPT - for newer java, there is still a very large list of fixes after the last versions, a lot has been fixed, including height coordinates (Z) geo-Squares, pathfinding, visibility through obstacles, fix pet summons, trade packages, shop packages, many effects, quests (including the original ones like nipples, etc.), Ai behavior of NPC and RB monsters, absolutely all epics have been transferred to AiLoader no longer in python scripts. Attention! The server is suitable for both classic mode and PvP format, as well as with various mods. Absolutely everything is configured in the configurations to suit your taste and purposes of use. It is recommended to launch the server through L2ServerControl (simplifies management and control of processes). Download Servers: Chronicle 3 Server Chronicle 4 Test Upgraded Server Full Desc & screens: Post & Screens c3 Post & Desc c4    
    • 🎃 HALLOWEEN EVENT 🎃   ‼️ Information and details: https://forum.l2harbor.com/threads/halloween-event-fall-harvest-30-10-07-11.8265/post-168620
  • 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