找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
楼主: foggy

[客户端] GMS083 大背包 ExpandedItem

[复制链接]

5

主题

21

回帖

82

积分

注册会员

积分
82
发表于 2025-10-3 10:22:23 | 显示全部楼层
今天抽空尝试了一下,很顺利地实现了~
再次前来感谢大佬的干货分享~!


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

5

主题

21

回帖

82

积分

注册会员

积分
82
发表于 2025-11-13 18:52:35 | 显示全部楼层

foggy大佬好~
我先搬运一下11月11日discord上@test234_大佬发布的大背包修复资料(ExpandedItem 11.Nov.2025)。然后还有些问题想请教。
在先前foggy大佬一楼已经分享的修改基础上,11月11日的版本里做了如下更新:
原本ijl15里的codecaves.h有这段代码:
  1. // Edit Foggy Set the isItemSlotIDover96 to ture if ID is over 96
  2. DWORD getItemSlotRectNewRtn = 0x0081E2CD;
  3. __declspec(naked) void getItemSlotRectNew()
  4. {
  5.         __asm {
  6.                 push ebp
  7.                 mov ebp, esp
  8.                 push ecx
  9.                 push ecx
  10.                 pushad
  11.                 pushfd
  12.                 mov eax, [ebp + 8]
  13.                 cmp eax, 60h
  14.                 setg byte ptr[isItemSlotIDover96]
  15.                 jle skip_sub
  16.                 sub eax, 60h
  17.                 mov[ebp + 8], eax
  18.                 skip_sub :
  19.                 popfd
  20.                 popad
  21.                 jmp getItemSlotRectNewRtn
  22.         }
  23. }
复制代码

现在修改为:
  1. // Edit Foggy Set the isItemSlotIDover96 to ture if ID is over 96
  2. DWORD getItemSlotRectNewRtn = 0x0081E2CD;
  3. __declspec(naked) void getItemSlotRectNew()
  4. {
  5.         __asm {
  6.                 push ebp
  7.                 mov ebp, esp
  8.                 push ecx
  9.                 push ecx
  10.                 pushad
  11.                 pushfd
  12.                 mov [isItemSlotIDover96], 0
  13.                 cmp [ecx+604h], 0
  14.                 jz skip_sub
  15.                 mov eax, [ebp + 8]
  16.                 cmp eax, 60h
  17.                 setg byte ptr[isItemSlotIDover96]
  18.                 jle skip_sub
  19.                 sub eax, 60h
  20.                 mov[ebp + 8], eax
  21.                 skip_sub :
  22.                 popfd
  23.                 popad
  24.                 jmp getItemSlotRectNewRtn
  25.         }
  26. }
复制代码

除此之外,没有观察到对ijl15更改时的差异。
值得一提的是,@test234_大佬11月11日的版本里其实整合了不少对于服务端的更新,但他声明里表明,那些更新只适配Cosmic,以下是他ExpandedItem 11.Nov.2025服务端部分的原文:
  1. // SERVER CODE PART

  2. // As for server part, different servers have different code. Thus I will mark which server do these modifcations come from for reference. Mainly [Beidou] and [Cosmic]


  3. // [Beidou] Server/StorageInventory.java [Beidou]
  4. public class StorageInventory{
  5.         private final byte slotLimit; // Change to -> private final short slotLimit;
  6.        
  7.         public StorageInventory(){
  8.                 this.slotLimit = (byte) toSort.size();        // Change to -> this.slotLimit = (short) toSort.size();
  9.         }
  10.         private byte getSlotLimit() { // Change to -> private short getSlotLimit()
  11.         }
  12. }

  13. // [Beidou] Client/Character.java
  14. private Character(){
  15.         for (InventoryType type : InventoryType.values()) {
  16.                 byte b = 24; // Change to -> short b = 24;
  17.                 if (type == InventoryType.CASH) {
  18.                         b = 96; // Change to -> b = 192;
  19.                 }
  20.         }
  21. }
  22. public byte getSlots(int type) {        // Change to -> public short getSlots(int type) {
  23.         return type == InventoryType.CASH.getType() ? 96 : inventory[type].getSlotLimit(); // Change the 96 into 192
  24. }
  25. public boolean canGainSlots (int type, int slots){
  26.         return slots <= 96; // Change to -> return slots <= 192;
  27. }

  28. // [Beidou] Client/inventory/Inventory.java
  29. public class Inventory implements Iterable<Item> {
  30.         protected byte slotLimit; // Change to -> protected short slotLimit;
  31.         public Inventory(Character mc, InventoryType type, byte slotLimit) { // Change the byte into short       
  32.         public byte getSlotLimit() {         // Change the byte into short
  33.                 slotLimit = (byte) newLimit; // Change the byte into short
  34.         }
  35. }

  36. // [Beidou] util/PacketCreator.java
  37. protected static void addItemInfo(final OutPacket p, Item item, boolean zeroPosition) {
  38.         if (equip != null) {
  39.                 if (pos < 0) {
  40.                     pos *= -1;                 
  41.                 }
  42.                                 p.writeShort(pos > 100 ? pos - 100 : pos);
  43.             } else {
  44.                 p.writeByte(pos);
  45.     }
  46.         // Change the whole part above into the part below
  47.         if (equip != null) {
  48.         if (pos < 0) {
  49.             pos *= -1;
  50.             p.writeShort(pos > 100 ? pos - 100 : pos);
  51.          }
  52.         else{
  53.                         p.writeShort(pos);
  54.          }
  55.     } else {
  56.         p.writeByte(pos);
  57.     }
  58. }
  59. public static Packet modifyInventory(boolean updateTick, final List<ModifyInventory> mods) {
  60.         p.writeByte(mods.size());        // Change the writeByte into writeShort
  61. }

  62. // [Cosmic] Character.java
  63. // Thanks to @Yone and @Axel
  64. ret.getInventory(InventoryType.EQUIP).setSlotLimit(rs.getByte("equipslots"));
  65. ret.getInventory(InventoryType.USE).setSlotLimit(rs.getByte("useslots"));
  66. ret.getInventory(InventoryType.SETUP).setSlotLimit(rs.getByte("setupslots"));
  67. ret.getInventory(InventoryType.ETC).setSlotLimit(rs.getByte("etcslots"));
  68. ret.getInventory(InventoryType.CASH).setSlotLimit((short) 192);

  69. // [Cosmic] SpawnPetProcessor.java
  70. // byte change to short, thanks to @Dynamight
  71. public static void processSpawnPet(Client c, byte slot, boolean lead)

  72. // [Cosmic] SpawnPetHandler.java
  73. //  byte slot change short , but Packet using readByte(), can direct replace with readShort() ? , thanks to @Dynamight
  74.         byte slot = p.readByte();

  75. // [Cosmic] WeddingHandler.java
  76. //  byte change short, thanks to @Dynamight
  77. Item item = chrInv.getItem((byte) slot);

  78. // [Cosmic] SpawnPetProcessor.java
  79. // byte change short, thanks to @Dynamight
  80.         byte slot = (byte) p.readShort();
  81.                
  82. // [Cosmic] SpawnPetHandler.java
  83. // Thansk to Axel
  84. package net.server.channel.handlers;
  85. import client.Client;
  86. import client.processor.action.SpawnPetProcessor;
  87. import net.AbstractPacketHandler;
  88. import net.packet.InPacket;
  89. public final class SpawnPetHandler extends AbstractPacketHandler {
  90.     @Override
  91.     public final void handlePacket(InPacket p, Client c) {
  92.         p.readInt();
  93.         short slot = p.readShort();
  94.         boolean lead = p.readByte() == 1;

  95.         SpawnPetProcessor.processSpawnPet(c, slot, lead);
  96.     }
  97. }

复制代码


我已经对比了其中[Beidou]的部分,和先前foggy大佬分享时是一致的,没有任何变化。
按照我的理解,[Cosmic]的部分是基本不能给北斗用的(想请教:是否有值得借鉴的地方?),这次修复对于北斗来说,好像没什么修复。
我在用大背包时发现一个问题:对于被放在常规96格之后的装备,是没办法丢商店的。想请教一下这个问题修复的思路。

5

主题

26

回帖

100

积分

注册会员

积分
100
 楼主| 发表于 2025-11-15 14:56:27 | 显示全部楼层
江奈Mizuki 发表于 2025-11-13 18:52
foggy大佬好~
我先搬运一下11月11日discord上@test234_大佬发布的大背包修复资料(ExpandedItem 11.Nov.20 ...

都是我撒。

关于商店,你可以看看我在这个贴最后关于 NPCShopHandler 的补充,应该是解决这个问题。一般来说这个功能主要的Bug是服务器和客户端收发包的问题,可以在服务端断点或输出日志来跟踪问题原因
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|小黑屋|蘑菇物语

GMT+8, 2025-12-16 23:34 , Processed in 0.049498 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表