Axelut

shift+click show inventory

Aug 13th, 2023
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git aCis_game/java/net/sf/l2j/gameserver/model/actor/Player.java aCis_game/java/net/sf/l2j/gameserver/model/actor/Player.java
  2. index 023516a..46f58e3 100644
  3. --- aCis_game/java/net/sf/l2j/gameserver/model/actor/Player.java
  4. +++ aCis_game/java/net/sf/l2j/gameserver/model/actor/Player.java
  5. @@ -163,6 +164,8 @@
  6.  import net.sf.l2j.gameserver.network.serverpackets.ExServerPrimitive;
  7.  import net.sf.l2j.gameserver.network.serverpackets.ExSetCompassZoneCode;
  8.  import net.sf.l2j.gameserver.network.serverpackets.ExStorageMaxCount;
  9. +import net.sf.l2j.gameserver.network.serverpackets.GMHennaInfo;
  10. +import net.sf.l2j.gameserver.network.serverpackets.GMViewItemList;
  11.  import net.sf.l2j.gameserver.network.serverpackets.GetOnVehicle;
  12.  import net.sf.l2j.gameserver.network.serverpackets.HennaInfo;
  13.  import net.sf.l2j.gameserver.network.serverpackets.InventoryUpdate;
  14. @@ -2291,6 +2295,21 @@
  15.     @Override
  16.     public void onAction(Player player, boolean isCtrlPressed, boolean isShiftPressed)
  17.     {
  18. +       if (!isDead() && isShiftPressed)
  19. +       {
  20. +           if (!player.isGM())
  21. +           {
  22. +               if (!isGM())
  23. +                   player.sendPacket(new GMViewItemList(this, true));
  24. +               else
  25. +                   player.sendMessage("You can't use it on GMs!");
  26. +           }
  27. +           else
  28. +               player.sendPacket(new GMViewItemList(this));
  29. +           player.sendPacket(new GMHennaInfo(this));
  30. +           player.sendPacket(ActionFailed.STATIC_PACKET);
  31. +           return;
  32. +       }
  33.         if (player.getTarget() != this)
  34.             player.setTarget(this);
  35.         else
  36. diff --git aCis_game/java/net/sf/l2j/gameserver/network/serverpackets/GMViewItemList.java aCis_game/java/net/sf/l2j/gameserver/network/serverpackets/GMViewItemList.java
  37. index 3a9980d..223c11e 100644
  38. --- aCis_game/java/net/sf/l2j/gameserver/network/serverpackets/GMViewItemList.java
  39. +++ aCis_game/java/net/sf/l2j/gameserver/network/serverpackets/GMViewItemList.java
  40. @@ -12,6 +12,7 @@
  41.     private final Set<ItemInstance> _items;
  42.     private final int _limit;
  43.     private final String _playerName;
  44. +   private boolean noGM = false;
  45.    
  46.     public GMViewItemList(Player player)
  47.     {
  48. @@ -20,6 +21,14 @@
  49.         _limit = player.getStatus().getInventoryLimit();
  50.     }
  51.    
  52. +   public GMViewItemList(Player player, boolean noGM)
  53. +   {
  54. +       this.noGM = noGM;
  55. +       _items = player.getInventory().getItems();
  56. +       _playerName = player.getName();
  57. +       _limit = player.getStatus().getInventoryLimit();
  58. +   }
  59. +  
  60.     public GMViewItemList(Pet pet)
  61.     {
  62.         _items = pet.getInventory().getItems();
  63. @@ -39,6 +48,8 @@
  64.         for (ItemInstance temp : _items)
  65.         {
  66.             Item item = temp.getItem();
  67. +           if (noGM && !temp.isEquipped())
  68. +               continue;
  69.            
  70.             writeH(item.getType1());
  71.             writeD(temp.getObjectId());
Add Comment
Please, Sign In to add comment