i am sure it was an admin trying to edit the buylist of an npc.
Code: Select all
Index: AdminEditNpc.java===================================================================--- AdminEditNpc.java (revision 7093)+++ AdminEditNpc.java (working copy)@@ -623,7 +623,7 @@ if (Config.CUSTOM_MERCHANT_TABLES) table = "custom_merchant_buylists"; - PreparedStatement stmt = con.prepareStatement("INSERT INTO " + table + "(`item_id`,`price`,`shop_id`,`order`) VALUES (?,?,?,?)");+ PreparedStatement stmt = con.prepareStatement("INSERT INTO `" + table + "`(`item_id`,`price`,`shop_id`,`order`) VALUES (?,?,?,?)"); stmt.setInt(1, itemID); stmt.setLong(2, price); stmt.setInt(3, tradeListID);@@ -659,7 +659,7 @@ int updated = 0; if (Config.CUSTOM_MERCHANT_TABLES) {- PreparedStatement stmt = con.prepareStatement("UPDATE custom_merchant_buylists SET `price` = ? WHERE `shop_id` = ? AND `order` = ?");+ PreparedStatement stmt = con.prepareStatement("UPDATE `custom_merchant_buylists` SET `price` = ? WHERE `shop_id` = ? AND `order` = ?"); stmt.setLong(1, price); stmt.setInt(2, tradeListID); stmt.setInt(3, order);@@ -668,7 +668,7 @@ } if (updated == 0) {- PreparedStatement stmt = con.prepareStatement("UPDATE merchant_buylists SET `price` = ? WHERE `shop_id` = ? AND `order` = ?");+ PreparedStatement stmt = con.prepareStatement("UPDATE `merchant_buylists` SET `price` = ? WHERE `shop_id` = ? AND `order` = ?"); stmt.setLong(1, price); stmt.setInt(2, tradeListID); stmt.setInt(3, order);@@ -702,7 +702,7 @@ int updated = 0; if (Config.CUSTOM_MERCHANT_TABLES) {- PreparedStatement stmt = con.prepareStatement("DELETE FROM custom_merchant_buylists WHERE `shop_id` = ? AND `order` = ?");+ PreparedStatement stmt = con.prepareStatement("DELETE FROM `custom_merchant_buylists` WHERE `shop_id` = ? AND `order` = ?"); stmt.setInt(1, tradeListID); stmt.setInt(2, order); updated = stmt.executeUpdate();@@ -710,7 +710,7 @@ } if (updated == 0) {- PreparedStatement stmt = con.prepareStatement("DELETE FROM merchant_buylists WHERE `shop_id` = ? AND `order` = ?");+ PreparedStatement stmt = con.prepareStatement("DELETE FROM `merchant_buylists` WHERE `shop_id` = ? AND `order` = ?"); stmt.setInt(1, tradeListID); stmt.setInt(2, order); updated = stmt.executeUpdate();@@ -740,7 +740,7 @@ try { con = L2DatabaseFactory.getInstance().getConnection();- PreparedStatement stmt = con.prepareStatement("SELECT order FROM merchant_buylists WHERE `shop_id` = ? AND `item_id` = ? AND `price` = ?");+ PreparedStatement stmt = con.prepareStatement("SELECT `order` FROM `merchant_buylists` WHERE `shop_id` = ? AND `item_id` = ? AND `price` = ?"); stmt.setInt(1, tradeListID); stmt.setInt(2, itemID); stmt.setLong(3, price);@@ -1179,7 +1179,7 @@ int updated = 0; if (Config.CUSTOM_DROPLIST_TABLE) {- PreparedStatement statement = con.prepareStatement("UPDATE custom_droplist SET min=?, max=?, chance=? WHERE mobId=? AND itemId=? AND category=?");+ PreparedStatement statement = con.prepareStatement("UPDATE `custom_droplist` SET `min`=?, `max`=?, `chance`=? WHERE `mobId`=? AND `itemId`=? AND `category`=?"); statement.setInt(1, min); statement.setInt(2, max); statement.setInt(3, chance);@@ -1192,7 +1192,7 @@ } if (updated == 0) {- PreparedStatement statement = con.prepareStatement("UPDATE droplist SET min=?, max=?, chance=? WHERE mobId=? AND itemId=? AND category=?");+ PreparedStatement statement = con.prepareStatement("UPDATE `droplist` SET `min`=?, `max`=?, `chance`=? WHERE `mobId`=? AND `itemId`=? AND `category`=?"); statement.setInt(1, min); statement.setInt(2, max); statement.setInt(3, chance);@@ -1238,7 +1238,7 @@ if (Config.CUSTOM_DROPLIST_TABLE) table = "custom_droplist"; - PreparedStatement statement = con.prepareStatement("INSERT INTO " + table + "(mobId, itemId, min, max, category, chance) values(?,?,?,?,?,?)");+ PreparedStatement statement = con.prepareStatement("INSERT INTO `" + table + "`(`mobId`, `itemId`, `min`, `max`, `category`, `chance`) VALUES(?,?,?,?,?,?)"); statement.setInt(1, npcId); statement.setInt(2, itemId); statement.setInt(3, min);@@ -1307,7 +1307,7 @@ int updated = 0; if (Config.CUSTOM_DROPLIST_TABLE) {- PreparedStatement statement = con.prepareStatement("DELETE FROM custom_droplist WHERE mobId=? AND itemId=? AND category=?");+ PreparedStatement statement = con.prepareStatement("DELETE FROM `custom_droplist` WHERE `mobId`=? AND `itemId`=? AND `category`=?"); statement.setInt(1, npcId); statement.setInt(2, itemId); statement.setInt(3, category);@@ -1316,7 +1316,7 @@ } if (updated == 0) {- PreparedStatement statement = con.prepareStatement("DELETE FROM droplist WHERE mobId=? AND itemId=? AND category=?");+ PreparedStatement statement = con.prepareStatement("DELETE FROM `droplist` WHERE `mobId`=? AND `itemId`=? AND `category`=?"); statement.setInt(1, npcId); statement.setInt(2, itemId); statement.setInt(3, category);@@ -1363,7 +1363,7 @@ con = L2DatabaseFactory.getInstance().getConnection(); L2DropData dropData = null; - PreparedStatement statement = con.prepareStatement("SELECT mobId, itemId, min, max, category, chance FROM droplist WHERE mobId=?");+ PreparedStatement statement = con.prepareStatement("SELECT `mobId`, `itemId`, `min`, `max`, `category`, `chance` FROM `droplist` WHERE `mobId`=?"); statement.setInt(1, npcId); ResultSet dropDataList = statement.executeQuery(); @@ -1384,7 +1384,7 @@ if (Config.CUSTOM_DROPLIST_TABLE) {- PreparedStatement statement2 = con.prepareStatement("SELECT mobId, itemId, min, max, category, chance FROM custom_droplist WHERE mobId=?");+ PreparedStatement statement2 = con.prepareStatement("SELECT `mobId`, `itemId`, `min`, `max`, `category`, `chance` FROM `custom_droplist` WHERE `mobId`=?"); statement2.setInt(1, npcId); ResultSet dropDataList2 = statement2.executeQuery(); @@ -1594,7 +1594,7 @@ con = L2DatabaseFactory.getInstance().getConnection(); - PreparedStatement statement = con.prepareStatement("UPDATE npcskills SET level=? WHERE npcid=? AND skillid=?");+ PreparedStatement statement = con.prepareStatement("UPDATE `npcskills` SET `level`=? WHERE `npcid`=? AND `skillid`=?"); statement.setInt(1, level); statement.setInt(2, npcId); statement.setInt(3, skillId);@@ -1659,7 +1659,7 @@ con = L2DatabaseFactory.getInstance().getConnection(); - PreparedStatement statement = con.prepareStatement("INSERT INTO npcskills(npcid, skillid, level) values(?,?,?)");+ PreparedStatement statement = con.prepareStatement("INSERT INTO `npcskills`(`npcid`, `skillid`, `level`) VALUES(?,?,?)"); statement.setInt(1, npcId); statement.setInt(2, skillId); statement.setInt(3, level);@@ -1697,7 +1697,7 @@ if (npcId > 0) {- PreparedStatement statement2 = con.prepareStatement("DELETE FROM npcskills WHERE npcid=? AND skillid=?");+ PreparedStatement statement2 = con.prepareStatement("DELETE FROM `npcskills` WHERE `npcid`=? AND `skillid`=?"); statement2.setInt(1, npcId); statement2.setInt(2, skillId); statement2.execute();@@ -1739,7 +1739,7 @@ npcData.getSkills().clear(); // without race- PreparedStatement statement = con.prepareStatement("SELECT skillid, level FROM npcskills WHERE npcid=? AND skillid <> 4416");+ PreparedStatement statement = con.prepareStatement("SELECT `skillid`, `level` FROM `npcskills` WHERE `npcid`=? AND `skillid` <> 4416"); statement.setInt(1, npcId); ResultSet skillDataList = statement.executeQuery();