L2JMobius

Crusader World Trade Stack Pricing fix

Paiplayer · 2 · 918

Offline Paiplayer

  • Knight
  • ***
    • Posts: 74
When you put stackables items to sell in World Exchange the window shows the "price per unit" based on the Total price divided by the stack size. The final price of selling need to be the Total price itself, and not an calculation of Total * Stack Size .

When you set up the sell, however, the server set the total price as Total * Stack Size because of logical errors on  /L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/gameserver/instancemanager/WorldExchangeManager.java

https://ibb.co/z5GR0rH

How to easly fix it

For some reason my Eclipse is unable to create a patch to the file withouth replacing it entirely, then I'll explain here the two steps to fix:

1- Remove the line 327

Line to be removed:
Code: [Select]
long totalPrice = priceForEach * (item.getId() == Inventory.ADENA_ID ? 1 : amount);
2- At the line 369 (former line 370), replace totalPrice with priceForEach as follows:

From:
Code: [Select]
_itemBids.put(freeId, new WorldExchangeHolder(freeId, itemInstance, new ItemInfo(itemInstance), totalPrice, player.getObjectId(), WorldExchangeItemStatusType.WORLD_EXCHANGE_REGISTERED, category, System.currentTimeMillis(), endTime, true));
To:
Code: [Select]
_itemBids.put(freeId, new WorldExchangeHolder(freeId, itemInstance, new ItemInfo(itemInstance), priceForEach, player.getObjectId(), WorldExchangeItemStatusType.WORLD_EXCHANGE_REGISTERED, category, System.currentTimeMillis(), endTime, true));
Want a developer? Check here or call me on Discord: PaiPlayer#5051