天堂迷 發表於 2023-7-22 09:57

道具問題請教

道具欄位
假設道具欄裡面有100罐藥水,直接從道具裡面的垃圾桶丟棄,丟棄數量打1,但是還是全部都會丟棄,請問該修改哪一個封包或修改其他?

kertz1131 發表於 2023-7-22 10:11

C包~~~~~~~~有任何問題歡迎洽詢ㄌㄞˋ @346cpdmc

天堂迷 發表於 2023-7-22 10:46

kertz1131 發表於 2023-7-22 10:11
C包~~~~~~~~有任何問題歡迎洽詢ㄌㄞˋ @346cpdmc

有找到了,但可以請教大概要修改哪一段?謝謝你~


package com.lineage.server.clientpackets;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.lineage.echo.ClientExecutor;
import com.lineage.server.model.Instance.L1ItemInstance;
import com.lineage.server.model.Instance.L1PcInstance;
import com.lineage.server.model.Instance.L1PetInstance;
import com.lineage.server.serverpackets.S_ServerMessage;

/**
* 要求刪除物品
*
* @author daien
*
*/
public class C_DeleteInventoryItem extends ClientBasePacket {

        private static final Log _log = LogFactory.getLog(C_DeleteInventoryItem.class);

        /*
       * public C_DeleteInventoryItem() { }
       *
       * public C_DeleteInventoryItem(final byte[] abyte0, final ClientExecutor client) { super(abyte0); try { this.start(abyte0, client);
       *
       * } catch (final Exception e) { _log.error(e.getLocalizedMessage(), e); } }
       */

        @Override
        public void start(final byte[] decrypt, final ClientExecutor client) {
                try {
                        // 資料載入
                        this.read(decrypt);

                        final L1PcInstance pc = client.getActiveChar();
                        int delcount = readD();
                        for (int i = 0; i < delcount; i++) {
                                final int itemObjectId = this.readD();
                                int del_itemcount = readD();
                                final L1ItemInstance item = pc.getInventory().getItem(itemObjectId);

                                // 物品為空
                                if (item == null) {
                                        return;
                                }
                                if (item.getCount() <= 0) {
                                        return;
                                }

                                // 執行人物不是GM
                                if (!pc.isGm()) {
                                        if (item.getItem().isCantDelete()) {
                                                // 125 \f1你不能夠放棄此樣物品。
                                                pc.sendPackets(new S_ServerMessage(125));
                                                return;
                                        }
                                }

                                // 寵物
                                final Object[] petlist = pc.getPetList().values().toArray();
                                for (final Object petObject : petlist) {
                                        if (petObject instanceof L1PetInstance) {
                                                final L1PetInstance pet = (L1PetInstance) petObject;
                                                if (item.getId() == pet.getItemObjId()) {
                                                        // 125 \f1你不能夠放棄此樣物品。
                                                        pc.sendPackets(new S_ServerMessage(125));
                                                        return;
                                                }
                                        }
                                }

                                // 取回娃娃
                                if (pc.getDoll(item.getId()) != null) {
                                        // 1,181:這個魔法娃娃目前正在使用中。
                                        pc.sendPackets(new S_ServerMessage(1181));
                                        return;
                                }
                               
                                // 取回超級娃娃
                                if (pc.get_power_doll() != null) {
                                        if (pc.get_power_doll().getItemObjId() == item.getId()) {
                                                // 1,181:這個魔法娃娃目前正在使用中。
                                                pc.sendPackets(new S_ServerMessage("物品正在使用中"));
                                                return;
                                        }
                                }

                                if (item.isEquipped()) {
                                        // 125 \f1你不能夠放棄此樣物品。
                                        pc.sendPackets(new S_ServerMessage(125));
                                        return;
                                }
                                if (item.getBless() >= 128) { // 封印的裝備
                                        // 210 \f1%0%d是不可轉移的…
                                        pc.sendPackets(new S_ServerMessage(210, item.getItem().getNameId()));
                                        return;
                                }
                                // _log.info("人物:" + pc.getName() + "刪除物品" + item.getItem().getName()
                                // + " 物品OBJID:" + item.getId());

                                pc.getInventory().removeItem(item, item.getCount());
                                pc.turnOnOffLight();
                        }
                } catch (final Exception e) {
                        // _log.error(e.getLocalizedMessage(), e);

                } finally {
                        this.over();
                }
        }

        @Override
        public String getType() {
                return this.getClass().getSimpleName();
        }
}


kertz1131 發表於 2023-7-22 11:12

本帖最後由 kertz1131 於 2023-7-22 11:16 編輯

自行加上語法即可~~~~~~~~
有需要協助歡迎洽詢並報價~~~~~~~~~~

popokiss 發表於 2023-7-22 11:44

感謝分享感謝分享感謝分享感謝分享

天堂迷 發表於 2023-7-22 18:52

kertz1131 發表於 2023-7-22 11:12
自行加上語法即可~~~~~~~~
有需要協助歡迎洽詢並報價~~~~~~~~~~

感謝指點 加了語法後 有修復好了

kertz1131 發表於 2023-7-23 10:04

天堂迷 發表於 2023-7-22 18:52
感謝指點 加了語法後 有修復好了

您是境界天堂吧?需修復的非常非常多XD

天堂迷 發表於 2023-7-23 11:00

kertz1131 發表於 2023-7-23 10:04
您是境界天堂吧?需修復的非常非常多XD

不是喔

kertz1131 發表於 2023-7-23 19:47

天堂迷 發表於 2023-7-23 11:00
不是喔

了解 現在幾乎沒有底板會缺你說的那個小垃圾桶數量語法
頁: [1]
查看完整版本: 道具問題請教