TA的每日心情 | 开心 前天 14:01 |
---|
签到天数: 318 天 [LV.8]以坛为家I
管理员
- 积分
- 84994
|
找到 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));
- }
复制代码
|
|