查看: 465|回復: 0

[閒聊閒語] 元神系統能力值一鍵存檔

[複製鏈接]

66

主題

162

帖子

5629

金錢

火焰之影

Rank: 8Rank: 8

威望
0
精華
0
貢獻
0
鑽石
0
閱讀權限
50
積分
5791
在線時間
78 小時
相冊
0
日誌
0
好友
0
發表於 2026-2-2 20:26 | 顯示全部樓層 |閱讀模式
/**
         * 【優化】元神系統能力值一鍵存檔
         * 維護者: E.L. (2026-02-02)
         */
        @Override
        public void updateItemIntensifyAttributes(final L1ItemInstance item) throws Exception {
                Connection con = null;
                PreparedStatement pstm = null;
                try {
                        con = DatabaseFactory.get().getConnection();
                        // 注意:請確認資料庫 character_items 表格中有對應的欄位名稱
                        // 若欄位名稱不同(例如資料庫內叫 str 而非 item_str),請根據實際表格調整
                        pstm = con.prepareStatement(
                                        "UPDATE `character_items` SET " +
                                        "`item_attack`=?, `item_bow_attack`=?, `item_reduction_dmg`=?, " +
                                        "`item_sp`=?, `item_probability`=?, `item_str`=?, `item_dex`=?, " +
                                        "`item_int`=?, `item_hp`=?, `item_mp`=?, `item_con`=?, " +
                                        "`item_wis`=?, `item_cha`=? WHERE `id`=?");
                       
                        int i = 0;
                        pstm.setInt(++i, item.getItemAttack());
                        pstm.setInt(++i, item.getItemBowAttack());
                        pstm.setInt(++i, item.getItemReductionDmg());
                        pstm.setInt(++i, item.getItemSp());
                        pstm.setInt(++i, item.getItemprobability());
                        pstm.setInt(++i, item.getItemStr());
                        pstm.setInt(++i, item.getItemDex());
                        pstm.setInt(++i, item.getItemInt());
                        pstm.setInt(++i, item.getItemHp());
                        pstm.setInt(++i, item.getItemMp());
                        pstm.setInt(++i, item.getItemCon());
                        pstm.setInt(++i, item.getItemWis());
                        pstm.setInt(++i, item.getItemCha());
                        pstm.setInt(++i, item.getId());
                       
                        pstm.execute();

                } catch (final SQLException e) {
                        _log.error("元神系統整合更新發生異常: " + item.getId(), e);
                        throw e;
                } finally {
                        SQLUtil.close(pstm);
                        SQLUtil.close(con);
                }
        }





上一篇︰排排站!搖一搖~new!
下一篇︰2/2 搖一搖
您需要登錄後才可以回帖 登錄 | 註冊會員

本版積分規則

天堂私服列表

45客服

Archiver| 45天堂私服論壇   分享到微博! 分享到臉書! 分享到噗浪! 分享到維特! 分享到Google+! 分享到LINE!

45天堂私服發佈站 ©    天堂私服架設教學  提供最新天堂私服最新資訊

流量最高、品質最好、服務最優、玩家首選、最新天堂私服資訊,都在45天堂私服發佈站.    免責聲明

Sitetag
line客服聯繫
掃一掃二碼
Line客服聯繫
24H專人回覆
返回頂部 返回列表