Lon

Lv.1 初心者
管理成員
管理員
註冊
2022-08-27
文章
13
評分
4
聲望
0
修復前提: 先照著kaokao的修復方法弄到可以進商城 sendops.properties 內修改
[AppleScript] syntaxhighlighter_viewsource syntaxhighlighter_copycode

JavaScript:
CS_UPDATE = 0x157
CS_OPERATION = 0x158

CashShopOperation.java內EnterCS函數
[Java] syntaxhighlighter_viewsource syntaxhighlighter_copycode

JavaScript:
‐    c.getSession().write(MaplePacketCreator.serverBlocked(2));
‐    c.getSession().write(MaplePacketCreator.enableActions());
‐    /*            CashShopServer.getPlayerStorage().registerPlayer(chr);
‐    c.getSession().write(MTSCSPacket.warpCS(c));
‐    CSUpdate(c);*/
+   CashShopServer.getPlayerStorage().registerPlayer(chr);
+   c.getSession().write(MTSCSPacket.warpCS(c));
+   CSUpdate(c);

CashShopOperation.java內BuyCashItem函數
[AppleScript] syntaxhighlighter_viewsource syntaxhighlighter_copycode

JavaScript:
‐       } else if (action == 14) { //get item from csinventory
+      } else if (action == 13) { //get item from csinventory
...
‐       } else if (action == 15) { //put item in cash inventory
+      } else if (action == 14) { //get item from csinventory
...
‐       } else if (action == 36) { //36 = friendship, 30 = crush
+      } else if (action == 35 || action == 29 ) { //35 = friendship, 29 = crush
...
‐       } else if (action == 31) {
+      } else if (action == 30) {
...
‐       } else if (action == 33) {
+      } else if (action == 32) {

MTSCSPacket.java 下方函數覆蓋
[AppleScript] syntaxhighlighter_viewsource syntaxhighlighter_copycode

JavaScript:
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
        mplew.writeShort(SendPacketOpcode.CS_OPERATION.getValue());
        mplew.write(0x59);
        mplew.writeShort(slots);
        return mplew.getPacket();
    }
    public static MaplePacket confirmToCSInventory(IItem item, int accId, int sn) {
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
        mplew.writeShort(SendPacketOpcode.CS_OPERATION.getValue());
        mplew.write(0x61);
        addCashItemInfo(mplew, item, accId, sn, false);
        return mplew.getPacket();
    }
    public static MaplePacket confirmFromCSInventory(IItem item, short pos) {
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
        mplew.writeShort(SendPacketOpcode.CS_OPERATION.getValue());
        mplew.write(0x5F);
        mplew.writeShort(pos);
        PacketHelper.addItemInfo(mplew, item, true, true);

至於新增商城道具,SQL
[AppleScript] syntaxhighlighter_viewsource syntaxhighlighter_copycode

JavaScript:
gender,count,meso,discount_price,mark, unk_1, unk_2, unk_3 ) VALUES ( 10000198, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0);

價格也在Commodity.img.xml裡面設定

[轉發自 小馬論壇 白狐]