黑枫叶冒险论坛

超级管理员

181

帖子

26

回复

1019

积分

楼主
发表于 2023-01-03 15:36:03 | 查看: 467 | 回复: 0


找到 AbstractPlayerInteraction.java, 打开:


Copy codepublic void gainItem(int id, short quantity) {


和与其相关的改为

Copy code      public void gainItem(int id, short quantity) {

            MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();

                        if (id >= 5000000 && id <= 5000045) {http://forum.ragezone.com/editpost.php?do=editpost&p=3773709

            try {

                Connection con = (Connection) DatabaseConnection.getConnection();

                PreparedStatement ps = (PreparedStatement) con.prepareStatement("INSERT INTO pets (name, level, closeness, fullness) VALUES (?, ?, ?, ?)");

                ps.setString(1, ii.getName(id));

                ps.setInt(2, 1);

                ps.setInt(3, 0);

                ps.setInt(4, 100);

                ps.executeUpdate();

                ResultSet rs = ps.getGeneratedKeys();

                rs.next();

                //c.getPlayer().equipChanged();

                MapleInventoryManipulator.addById(c, id, (short) quantity, c.getPlayer().getName() + " receieved pet, ID " + id + ", from a scripted PlayerInteraction. (Quantity: " + quantity + ")", null, rs.getInt(1));

                rs.close();

                ps.close();

            } catch (SQLException ex) {

                java.util.logging.Logger.getLogger(AbstractPlayerInteraction.class.getName()).log(Level.SEVERE, null, ex);

            }

        } else {

        if (quantity >= 0) {

            StringBuilder logInfo = new StringBuilder(c.getPlayer().getName());

            logInfo.append(" received ");

            logInfo.append(quantity);

            logInfo.append(" from a scripted PlayerInteraction (");

            logInfo.append(this.toString());

            logInfo.append(")");

            MapleInventoryManipulator.addById(c, id, quantity, logInfo.toString());

               

        } else {

            MapleInventoryManipulator.removeById(c, MapleItemInformationProvider.getInstance().getInventoryType(id), id, -quantity, true, false);

                    }

                }

        c.getSession().write(MaplePacketCreator.getShowItemGain(id, quantity, true));

    }  


您需要登录后才可以回帖 登录 | 立即注册

声明:本站一切资源均来自互联网分享,仅用于学习和研究请勿商业用途

版权所有 黑枫叶 V1.0 © 2023