From 24e182cac27187e0c50b35241a53dd688a9606b8 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Wed, 11 Nov 2020 14:29:45 +0000 Subject: [PATCH] Save droplist when editing NPC. Contributed by G-hamsteR. --- .../admincommandhandlers/AdminEditNpc.java | 18 ++++++++++++++++++ .../admincommandhandlers/AdminEditNpc.java | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminEditNpc.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminEditNpc.java index 62e86ac7ae..5281470473 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminEditNpc.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminEditNpc.java @@ -1358,6 +1358,24 @@ public class AdminEditNpc implements IAdminCommandHandler } dropDataList.close(); statement.close(); + + final PreparedStatement statement2 = con.prepareStatement("SELECT mobId,itemId,min,max,category,chance FROM custom_droplist WHERE mobId=?"); + statement.setInt(1, npcId); + final ResultSet dropDataList2 = statement2.executeQuery(); + + while (dropDataList2.next()) + { + dropData = new DropData(); + dropData.setItemId(dropDataList2.getInt("itemId")); + dropData.setMinDrop(dropDataList2.getInt("min")); + dropData.setMaxDrop(dropDataList2.getInt("max")); + dropData.setChance(dropDataList2.getInt("chance")); + + final int category = dropDataList2.getInt("category"); + npcData.addDropData(dropData, category); + } + dropDataList2.close(); + statement2.close(); } catch (Exception e) { diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminEditNpc.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminEditNpc.java index 62e86ac7ae..5281470473 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminEditNpc.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminEditNpc.java @@ -1358,6 +1358,24 @@ public class AdminEditNpc implements IAdminCommandHandler } dropDataList.close(); statement.close(); + + final PreparedStatement statement2 = con.prepareStatement("SELECT mobId,itemId,min,max,category,chance FROM custom_droplist WHERE mobId=?"); + statement.setInt(1, npcId); + final ResultSet dropDataList2 = statement2.executeQuery(); + + while (dropDataList2.next()) + { + dropData = new DropData(); + dropData.setItemId(dropDataList2.getInt("itemId")); + dropData.setMinDrop(dropDataList2.getInt("min")); + dropData.setMaxDrop(dropDataList2.getInt("max")); + dropData.setChance(dropDataList2.getInt("chance")); + + final int category = dropDataList2.getInt("category"); + npcData.addDropData(dropData, category); + } + dropDataList2.close(); + statement2.close(); } catch (Exception e) {