A Project for Chronicle 4 based on L2JServer.


    Sorted Warehouse

    Share
    avatar
    Karakan

    Posts : 428
    Join date : 2013-10-04

    Sorted Warehouse

    Post  Karakan on 22nd October 2017, 16:02

    Adapted to our Project.
    It sorts all items in alphabetical order.

    I've seen a better one (L2DC) which also had html to choose the item type to show.
    But this should do fine too.



    Note :
    This had a config option.
    But I was to lazy to add it. ^^
    If needed let me know and i'll add it.


    ========================

    Create a new files called  SortedWareHouseWithdrawalList.java

    in  "..\java\net\sf\l2j\gameserver\serverpackets"

    Content:  https://pastebin.com/fb8LySYR

    ========================

    Create a new files called  L2WarehouseItem.java

    in  ..\java\net\sf\l2j\gameserver\templates

    Content:  https://pastebin.com/mPpgKzLm

    ========================


    And here are the diffs :


    Code:
    Index: L2CastleWarehouseInstance.java
    ===================================================================
    --- L2CastleWarehouseInstance.java (revision 595)
    +++ L2CastleWarehouseInstance.java (working copy)
    @@ -22,9 +22,11 @@
     import net.sf.l2j.gameserver.model.L2Clan;
     import net.sf.l2j.gameserver.serverpackets.ActionFailed;
     import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;
    +import net.sf.l2j.gameserver.serverpackets.SortedWareHouseWithdrawalList;
     import net.sf.l2j.gameserver.serverpackets.SystemMessage;
     import net.sf.l2j.gameserver.serverpackets.WareHouseDepositList;
     import net.sf.l2j.gameserver.serverpackets.WareHouseWithdrawalList;
    +import net.sf.l2j.gameserver.serverpackets.SortedWareHouseWithdrawalList.WarehouseListType;
     import net.sf.l2j.gameserver.templates.L2NpcTemplate;
     
     /**
    @@ -60,7 +62,7 @@
     _log.fine("Showing stored items");
     }
     
    - player.sendPacket(new WareHouseWithdrawalList(player, WareHouseWithdrawalList.Private));
    +     player.sendPacket(new SortedWareHouseWithdrawalList(player, WareHouseWithdrawalList.Private,WarehouseListType.ALL,SortedWareHouseWithdrawalList.A2Z));
     }
     
     private void showDepositWindow(L2PcInstance player)
    @@ -127,9 +129,8 @@
     {
     _log.fine("Showing items to withdraw - clan");
     }
    -
    - player.sendPacket(new WareHouseWithdrawalList(player, WareHouseWithdrawalList.Clan));
    -
    +
    +         player.sendPacket(new SortedWareHouseWithdrawalList(player, WareHouseWithdrawalList.Clan,WarehouseListType.ALL,SortedWareHouseWithdrawalList.A2Z));
     }
     }




    Code:

    Index: L2WarehouseInstance.java
    ===================================================================
    --- L2WarehouseInstance.java (revision 595)
    +++ L2WarehouseInstance.java (working copy)
    @@ -29,6 +29,8 @@
     import net.sf.l2j.gameserver.serverpackets.SystemMessage;
     import net.sf.l2j.gameserver.serverpackets.WareHouseDepositList;
     import net.sf.l2j.gameserver.serverpackets.WareHouseWithdrawalList;
    +import net.sf.l2j.gameserver.serverpackets.SortedWareHouseWithdrawalList.WarehouseListType;
    +import net.sf.l2j.gameserver.serverpackets.SortedWareHouseWithdrawalList;
     import net.sf.l2j.gameserver.templates.L2NpcTemplate;
     
     /**
    @@ -79,8 +81,8 @@
     {
     _log.fine("Showing stored items");
     }
    -
    - player.sendPacket(new WareHouseWithdrawalList(player, WareHouseWithdrawalList.Private));
    +
    +       player.sendPacket(new SortedWareHouseWithdrawalList(player, WareHouseWithdrawalList.Private, WarehouseListType.ALL,SortedWareHouseWithdrawalList.A2Z));
     }
     
     private void showDepositWindow(L2PcInstance player)
    @@ -140,14 +142,12 @@
     }
     
     player.setActiveWarehouse(player.getClan().getWarehouse());
    +     player.sendPacket(new SortedWareHouseWithdrawalList(player, WareHouseWithdrawalList.Clan, WarehouseListType.ALL, SortedWareHouseWithdrawalList.A2Z));
     
     if (Config.DEBUG)
     {
     _log.fine("Showing items to withdraw - clan");
     }
    -
    - player.sendPacket(new WareHouseWithdrawalList(player, WareHouseWithdrawalList.Clan));
    -
     }
     
     private void showWithdrawWindowFreight(L2PcInstance player)
    @@ -180,8 +180,8 @@
     }
     
     player.setActiveWarehouse(freight);
    - player.sendPacket(new WareHouseWithdrawalList(player, WareHouseWithdrawalList.Freight));
    - }
    +             player.sendPacket(new SortedWareHouseWithdrawalList(player, WareHouseWithdrawalList.Freight, WarehouseListType.ALL, SortedWareHouseWithdrawalList.A2Z));
    + }
     else
     {
     player.sendPacket(new SystemMessage(SystemMessage.NO_PACKAGES_ARRIVED));






    Have Fun! Smile

    FULL_LOL

    Posts : 3
    Join date : 2013-07-05

    Re: Sorted Warehouse

    Post  FULL_LOL on 16th November 2017, 15:09

    Karakan wrote:Adapted to our Project.
    It sorts all items in alphabetical order.

    Note :
    This had a config option.
    But I was to lazy to add it. ^^
    If needed let me know and i'll add it.


    How would it be to put this option in the settings? true or false ?
    avatar
    Karakan

    Posts : 428
    Join date : 2013-10-04

    Re: Sorted Warehouse

    Post  Karakan on 16th November 2017, 21:55

    Here is the original code for Interlude.
    Just add the missing "config" lines.

    Code:
    https://pastebin.com/0ins85Mi



    Regards

    Sponsored content

    Re: Sorted Warehouse

    Post  Sponsored content


      Current date/time is 22nd November 2017, 05:46