From 2b6b39770064207f3c610ce5201ca09634a12a34 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Tue, 19 Mar 2019 01:51:43 +0000 Subject: [PATCH] Addition of admin destroy item commands. --- .../dist/game/config/AdminCommands.xml | 6 ++ .../data/scripts/handlers/MasterHandler.java | 2 + .../AdminDestroyItems.java | 61 +++++++++++++++++++ .../dist/game/config/AdminCommands.xml | 6 ++ .../data/scripts/handlers/MasterHandler.java | 2 + .../AdminDestroyItems.java | 61 +++++++++++++++++++ .../dist/game/config/AdminCommands.xml | 6 ++ .../data/scripts/handlers/MasterHandler.java | 2 + .../AdminDestroyItems.java | 61 +++++++++++++++++++ .../dist/game/config/AdminCommands.xml | 6 ++ .../data/scripts/handlers/MasterHandler.java | 2 + .../AdminDestroyItems.java | 61 +++++++++++++++++++ .../dist/game/config/AdminCommands.xml | 6 ++ .../data/scripts/handlers/MasterHandler.java | 2 + .../AdminDestroyItems.java | 61 +++++++++++++++++++ .../dist/game/config/AdminCommands.xml | 6 ++ .../data/scripts/handlers/MasterHandler.java | 2 + .../AdminDestroyItems.java | 61 +++++++++++++++++++ .../dist/game/config/AdminCommands.xml | 6 ++ .../data/scripts/handlers/MasterHandler.java | 2 + .../AdminDestroyItems.java | 61 +++++++++++++++++++ .../dist/game/config/AdminCommands.xml | 6 ++ .../data/scripts/handlers/MasterHandler.java | 2 + .../AdminDestroyItems.java | 61 +++++++++++++++++++ .../dist/game/config/AdminCommands.xml | 6 ++ .../data/scripts/handlers/MasterHandler.java | 2 + .../AdminDestroyItems.java | 61 +++++++++++++++++++ .../dist/game/config/AdminCommands.xml | 6 ++ .../data/scripts/handlers/MasterHandler.java | 2 + .../AdminDestroyItems.java | 61 +++++++++++++++++++ .../dist/game/config/AdminCommands.xml | 6 ++ .../data/scripts/handlers/MasterHandler.java | 2 + .../AdminDestroyItems.java | 61 +++++++++++++++++++ .../dist/game/config/AdminCommands.xml | 6 ++ .../data/scripts/handlers/MasterHandler.java | 2 + .../AdminDestroyItems.java | 61 +++++++++++++++++++ 36 files changed, 828 insertions(+) create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java create mode 100644 L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java create mode 100644 L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java create mode 100644 L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java create mode 100644 L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java create mode 100644 L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/config/AdminCommands.xml b/L2J_Mobius_1.0_Ertheia/dist/game/config/AdminCommands.xml index 0c4b249e56..533a647745 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/config/AdminCommands.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/config/AdminCommands.xml @@ -96,6 +96,12 @@ + + + + + + diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/MasterHandler.java index f5f695215b..eb1af59d6d 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/MasterHandler.java @@ -69,6 +69,7 @@ import handlers.admincommandhandlers.AdminClanHall; import handlers.admincommandhandlers.AdminCreateItem; import handlers.admincommandhandlers.AdminCursedWeapons; import handlers.admincommandhandlers.AdminDelete; +import handlers.admincommandhandlers.AdminDestroyItems; import handlers.admincommandhandlers.AdminDisconnect; import handlers.admincommandhandlers.AdminDoorControl; import handlers.admincommandhandlers.AdminEditChar; @@ -403,6 +404,7 @@ public class MasterHandler AdminCreateItem.class, AdminCursedWeapons.class, AdminDelete.class, + AdminDestroyItems.class, AdminDisconnect.class, AdminDoorControl.class, AdminEditChar.class, diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java new file mode 100644 index 0000000000..105a8eb1d3 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java @@ -0,0 +1,61 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.admincommandhandlers; + +import com.l2jmobius.gameserver.handler.IAdminCommandHandler; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.itemcontainer.PcInventory; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; + +/** + * @author Mobius + */ +public class AdminDestroyItems implements IAdminCommandHandler +{ + private static final String[] ADMIN_COMMANDS = + { + "admin_destroy_items", + "admin_destroy_all_items", + "admin_destroyitems", + "admin_destroyallitems" + }; + + @Override + public boolean useAdminCommand(String command, L2PcInstance activeChar) + { + final PcInventory inventory = activeChar.getInventory(); + final InventoryUpdate iu = new InventoryUpdate(); + for (L2ItemInstance item : inventory.getItems()) + { + if (item.isEquipped() && !command.contains("all")) + { + continue; + } + iu.addRemovedItem(item); + inventory.destroyItem("Admin Destroy", item, activeChar, null); + } + activeChar.sendPacket(iu); + return true; + } + + @Override + public String[] getAdminCommandList() + { + return ADMIN_COMMANDS; + } +} diff --git a/L2J_Mobius_2.5_Underground/dist/game/config/AdminCommands.xml b/L2J_Mobius_2.5_Underground/dist/game/config/AdminCommands.xml index 0c4b249e56..533a647745 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/config/AdminCommands.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/config/AdminCommands.xml @@ -96,6 +96,12 @@ + + + + + + diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/MasterHandler.java index 28a2143e1e..9698aef579 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/MasterHandler.java @@ -69,6 +69,7 @@ import handlers.admincommandhandlers.AdminClanHall; import handlers.admincommandhandlers.AdminCreateItem; import handlers.admincommandhandlers.AdminCursedWeapons; import handlers.admincommandhandlers.AdminDelete; +import handlers.admincommandhandlers.AdminDestroyItems; import handlers.admincommandhandlers.AdminDisconnect; import handlers.admincommandhandlers.AdminDoorControl; import handlers.admincommandhandlers.AdminEditChar; @@ -404,6 +405,7 @@ public class MasterHandler AdminCreateItem.class, AdminCursedWeapons.class, AdminDelete.class, + AdminDestroyItems.class, AdminDisconnect.class, AdminDoorControl.class, AdminEditChar.class, diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java new file mode 100644 index 0000000000..105a8eb1d3 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java @@ -0,0 +1,61 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.admincommandhandlers; + +import com.l2jmobius.gameserver.handler.IAdminCommandHandler; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.itemcontainer.PcInventory; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; + +/** + * @author Mobius + */ +public class AdminDestroyItems implements IAdminCommandHandler +{ + private static final String[] ADMIN_COMMANDS = + { + "admin_destroy_items", + "admin_destroy_all_items", + "admin_destroyitems", + "admin_destroyallitems" + }; + + @Override + public boolean useAdminCommand(String command, L2PcInstance activeChar) + { + final PcInventory inventory = activeChar.getInventory(); + final InventoryUpdate iu = new InventoryUpdate(); + for (L2ItemInstance item : inventory.getItems()) + { + if (item.isEquipped() && !command.contains("all")) + { + continue; + } + iu.addRemovedItem(item); + inventory.destroyItem("Admin Destroy", item, activeChar, null); + } + activeChar.sendPacket(iu); + return true; + } + + @Override + public String[] getAdminCommandList() + { + return ADMIN_COMMANDS; + } +} diff --git a/L2J_Mobius_3.0_Helios/dist/game/config/AdminCommands.xml b/L2J_Mobius_3.0_Helios/dist/game/config/AdminCommands.xml index 0c4b249e56..533a647745 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/config/AdminCommands.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/config/AdminCommands.xml @@ -96,6 +96,12 @@ + + + + + + diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/MasterHandler.java index 4199a14f37..8010a3fd1b 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/MasterHandler.java @@ -69,6 +69,7 @@ import handlers.admincommandhandlers.AdminClanHall; import handlers.admincommandhandlers.AdminCreateItem; import handlers.admincommandhandlers.AdminCursedWeapons; import handlers.admincommandhandlers.AdminDelete; +import handlers.admincommandhandlers.AdminDestroyItems; import handlers.admincommandhandlers.AdminDisconnect; import handlers.admincommandhandlers.AdminDoorControl; import handlers.admincommandhandlers.AdminEditChar; @@ -405,6 +406,7 @@ public class MasterHandler AdminCreateItem.class, AdminCursedWeapons.class, AdminDelete.class, + AdminDestroyItems.class, AdminDisconnect.class, AdminDoorControl.class, AdminEditChar.class, diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java new file mode 100644 index 0000000000..105a8eb1d3 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java @@ -0,0 +1,61 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.admincommandhandlers; + +import com.l2jmobius.gameserver.handler.IAdminCommandHandler; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.itemcontainer.PcInventory; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; + +/** + * @author Mobius + */ +public class AdminDestroyItems implements IAdminCommandHandler +{ + private static final String[] ADMIN_COMMANDS = + { + "admin_destroy_items", + "admin_destroy_all_items", + "admin_destroyitems", + "admin_destroyallitems" + }; + + @Override + public boolean useAdminCommand(String command, L2PcInstance activeChar) + { + final PcInventory inventory = activeChar.getInventory(); + final InventoryUpdate iu = new InventoryUpdate(); + for (L2ItemInstance item : inventory.getItems()) + { + if (item.isEquipped() && !command.contains("all")) + { + continue; + } + iu.addRemovedItem(item); + inventory.destroyItem("Admin Destroy", item, activeChar, null); + } + activeChar.sendPacket(iu); + return true; + } + + @Override + public String[] getAdminCommandList() + { + return ADMIN_COMMANDS; + } +} diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/AdminCommands.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/AdminCommands.xml index 0c4b249e56..533a647745 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/AdminCommands.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/AdminCommands.xml @@ -96,6 +96,12 @@ + + + + + + diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/MasterHandler.java index 4199a14f37..8010a3fd1b 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/MasterHandler.java @@ -69,6 +69,7 @@ import handlers.admincommandhandlers.AdminClanHall; import handlers.admincommandhandlers.AdminCreateItem; import handlers.admincommandhandlers.AdminCursedWeapons; import handlers.admincommandhandlers.AdminDelete; +import handlers.admincommandhandlers.AdminDestroyItems; import handlers.admincommandhandlers.AdminDisconnect; import handlers.admincommandhandlers.AdminDoorControl; import handlers.admincommandhandlers.AdminEditChar; @@ -405,6 +406,7 @@ public class MasterHandler AdminCreateItem.class, AdminCursedWeapons.class, AdminDelete.class, + AdminDestroyItems.class, AdminDisconnect.class, AdminDoorControl.class, AdminEditChar.class, diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java new file mode 100644 index 0000000000..105a8eb1d3 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java @@ -0,0 +1,61 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.admincommandhandlers; + +import com.l2jmobius.gameserver.handler.IAdminCommandHandler; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.itemcontainer.PcInventory; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; + +/** + * @author Mobius + */ +public class AdminDestroyItems implements IAdminCommandHandler +{ + private static final String[] ADMIN_COMMANDS = + { + "admin_destroy_items", + "admin_destroy_all_items", + "admin_destroyitems", + "admin_destroyallitems" + }; + + @Override + public boolean useAdminCommand(String command, L2PcInstance activeChar) + { + final PcInventory inventory = activeChar.getInventory(); + final InventoryUpdate iu = new InventoryUpdate(); + for (L2ItemInstance item : inventory.getItems()) + { + if (item.isEquipped() && !command.contains("all")) + { + continue; + } + iu.addRemovedItem(item); + inventory.destroyItem("Admin Destroy", item, activeChar, null); + } + activeChar.sendPacket(iu); + return true; + } + + @Override + public String[] getAdminCommandList() + { + return ADMIN_COMMANDS; + } +} diff --git a/L2J_Mobius_5.0_Salvation/dist/game/config/AdminCommands.xml b/L2J_Mobius_5.0_Salvation/dist/game/config/AdminCommands.xml index 0c4b249e56..533a647745 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/config/AdminCommands.xml +++ b/L2J_Mobius_5.0_Salvation/dist/game/config/AdminCommands.xml @@ -96,6 +96,12 @@ + + + + + + diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/MasterHandler.java index 4199a14f37..8010a3fd1b 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/MasterHandler.java @@ -69,6 +69,7 @@ import handlers.admincommandhandlers.AdminClanHall; import handlers.admincommandhandlers.AdminCreateItem; import handlers.admincommandhandlers.AdminCursedWeapons; import handlers.admincommandhandlers.AdminDelete; +import handlers.admincommandhandlers.AdminDestroyItems; import handlers.admincommandhandlers.AdminDisconnect; import handlers.admincommandhandlers.AdminDoorControl; import handlers.admincommandhandlers.AdminEditChar; @@ -405,6 +406,7 @@ public class MasterHandler AdminCreateItem.class, AdminCursedWeapons.class, AdminDelete.class, + AdminDestroyItems.class, AdminDisconnect.class, AdminDoorControl.class, AdminEditChar.class, diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java new file mode 100644 index 0000000000..105a8eb1d3 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java @@ -0,0 +1,61 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.admincommandhandlers; + +import com.l2jmobius.gameserver.handler.IAdminCommandHandler; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.itemcontainer.PcInventory; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; + +/** + * @author Mobius + */ +public class AdminDestroyItems implements IAdminCommandHandler +{ + private static final String[] ADMIN_COMMANDS = + { + "admin_destroy_items", + "admin_destroy_all_items", + "admin_destroyitems", + "admin_destroyallitems" + }; + + @Override + public boolean useAdminCommand(String command, L2PcInstance activeChar) + { + final PcInventory inventory = activeChar.getInventory(); + final InventoryUpdate iu = new InventoryUpdate(); + for (L2ItemInstance item : inventory.getItems()) + { + if (item.isEquipped() && !command.contains("all")) + { + continue; + } + iu.addRemovedItem(item); + inventory.destroyItem("Admin Destroy", item, activeChar, null); + } + activeChar.sendPacket(iu); + return true; + } + + @Override + public String[] getAdminCommandList() + { + return ADMIN_COMMANDS; + } +} diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/config/AdminCommands.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/config/AdminCommands.xml index 0c4b249e56..533a647745 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/config/AdminCommands.xml +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/config/AdminCommands.xml @@ -96,6 +96,12 @@ + + + + + + diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/MasterHandler.java index 4199a14f37..8010a3fd1b 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/MasterHandler.java @@ -69,6 +69,7 @@ import handlers.admincommandhandlers.AdminClanHall; import handlers.admincommandhandlers.AdminCreateItem; import handlers.admincommandhandlers.AdminCursedWeapons; import handlers.admincommandhandlers.AdminDelete; +import handlers.admincommandhandlers.AdminDestroyItems; import handlers.admincommandhandlers.AdminDisconnect; import handlers.admincommandhandlers.AdminDoorControl; import handlers.admincommandhandlers.AdminEditChar; @@ -405,6 +406,7 @@ public class MasterHandler AdminCreateItem.class, AdminCursedWeapons.class, AdminDelete.class, + AdminDestroyItems.class, AdminDisconnect.class, AdminDoorControl.class, AdminEditChar.class, diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java new file mode 100644 index 0000000000..105a8eb1d3 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java @@ -0,0 +1,61 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.admincommandhandlers; + +import com.l2jmobius.gameserver.handler.IAdminCommandHandler; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.itemcontainer.PcInventory; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; + +/** + * @author Mobius + */ +public class AdminDestroyItems implements IAdminCommandHandler +{ + private static final String[] ADMIN_COMMANDS = + { + "admin_destroy_items", + "admin_destroy_all_items", + "admin_destroyitems", + "admin_destroyallitems" + }; + + @Override + public boolean useAdminCommand(String command, L2PcInstance activeChar) + { + final PcInventory inventory = activeChar.getInventory(); + final InventoryUpdate iu = new InventoryUpdate(); + for (L2ItemInstance item : inventory.getItems()) + { + if (item.isEquipped() && !command.contains("all")) + { + continue; + } + iu.addRemovedItem(item); + inventory.destroyItem("Admin Destroy", item, activeChar, null); + } + activeChar.sendPacket(iu); + return true; + } + + @Override + public String[] getAdminCommandList() + { + return ADMIN_COMMANDS; + } +} diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/config/AdminCommands.xml b/L2J_Mobius_6.0_Fafurion/dist/game/config/AdminCommands.xml index 0c4b249e56..533a647745 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/config/AdminCommands.xml +++ b/L2J_Mobius_6.0_Fafurion/dist/game/config/AdminCommands.xml @@ -96,6 +96,12 @@ + + + + + + diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/MasterHandler.java index 4199a14f37..8010a3fd1b 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/MasterHandler.java @@ -69,6 +69,7 @@ import handlers.admincommandhandlers.AdminClanHall; import handlers.admincommandhandlers.AdminCreateItem; import handlers.admincommandhandlers.AdminCursedWeapons; import handlers.admincommandhandlers.AdminDelete; +import handlers.admincommandhandlers.AdminDestroyItems; import handlers.admincommandhandlers.AdminDisconnect; import handlers.admincommandhandlers.AdminDoorControl; import handlers.admincommandhandlers.AdminEditChar; @@ -405,6 +406,7 @@ public class MasterHandler AdminCreateItem.class, AdminCursedWeapons.class, AdminDelete.class, + AdminDestroyItems.class, AdminDisconnect.class, AdminDoorControl.class, AdminEditChar.class, diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java new file mode 100644 index 0000000000..105a8eb1d3 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java @@ -0,0 +1,61 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.admincommandhandlers; + +import com.l2jmobius.gameserver.handler.IAdminCommandHandler; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.itemcontainer.PcInventory; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; + +/** + * @author Mobius + */ +public class AdminDestroyItems implements IAdminCommandHandler +{ + private static final String[] ADMIN_COMMANDS = + { + "admin_destroy_items", + "admin_destroy_all_items", + "admin_destroyitems", + "admin_destroyallitems" + }; + + @Override + public boolean useAdminCommand(String command, L2PcInstance activeChar) + { + final PcInventory inventory = activeChar.getInventory(); + final InventoryUpdate iu = new InventoryUpdate(); + for (L2ItemInstance item : inventory.getItems()) + { + if (item.isEquipped() && !command.contains("all")) + { + continue; + } + iu.addRemovedItem(item); + inventory.destroyItem("Admin Destroy", item, activeChar, null); + } + activeChar.sendPacket(iu); + return true; + } + + @Override + public String[] getAdminCommandList() + { + return ADMIN_COMMANDS; + } +} diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/AdminCommands.xml b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/AdminCommands.xml index 9691649f51..6ee6ed64d8 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/AdminCommands.xml +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/AdminCommands.xml @@ -92,6 +92,12 @@ + + + + + + diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/MasterHandler.java index 7eff18e8f8..9e375be5f0 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/MasterHandler.java @@ -65,6 +65,7 @@ import handlers.admincommandhandlers.AdminClan; import handlers.admincommandhandlers.AdminCreateItem; import handlers.admincommandhandlers.AdminCursedWeapons; import handlers.admincommandhandlers.AdminDelete; +import handlers.admincommandhandlers.AdminDestroyItems; import handlers.admincommandhandlers.AdminDisconnect; import handlers.admincommandhandlers.AdminDoorControl; import handlers.admincommandhandlers.AdminEditChar; @@ -365,6 +366,7 @@ public class MasterHandler AdminCreateItem.class, AdminCursedWeapons.class, AdminDelete.class, + AdminDestroyItems.class, AdminDisconnect.class, AdminDoorControl.class, AdminEditChar.class, diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java new file mode 100644 index 0000000000..105a8eb1d3 --- /dev/null +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java @@ -0,0 +1,61 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.admincommandhandlers; + +import com.l2jmobius.gameserver.handler.IAdminCommandHandler; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.itemcontainer.PcInventory; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; + +/** + * @author Mobius + */ +public class AdminDestroyItems implements IAdminCommandHandler +{ + private static final String[] ADMIN_COMMANDS = + { + "admin_destroy_items", + "admin_destroy_all_items", + "admin_destroyitems", + "admin_destroyallitems" + }; + + @Override + public boolean useAdminCommand(String command, L2PcInstance activeChar) + { + final PcInventory inventory = activeChar.getInventory(); + final InventoryUpdate iu = new InventoryUpdate(); + for (L2ItemInstance item : inventory.getItems()) + { + if (item.isEquipped() && !command.contains("all")) + { + continue; + } + iu.addRemovedItem(item); + inventory.destroyItem("Admin Destroy", item, activeChar, null); + } + activeChar.sendPacket(iu); + return true; + } + + @Override + public String[] getAdminCommandList() + { + return ADMIN_COMMANDS; + } +} diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/AdminCommands.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/AdminCommands.xml index 876a4afa34..27a86bc015 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/AdminCommands.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/AdminCommands.xml @@ -96,6 +96,12 @@ + + + + + + diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/MasterHandler.java index 8f5af6190c..df58d04db2 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/MasterHandler.java @@ -69,6 +69,7 @@ import handlers.admincommandhandlers.AdminClanHall; import handlers.admincommandhandlers.AdminCreateItem; import handlers.admincommandhandlers.AdminCursedWeapons; import handlers.admincommandhandlers.AdminDelete; +import handlers.admincommandhandlers.AdminDestroyItems; import handlers.admincommandhandlers.AdminDisconnect; import handlers.admincommandhandlers.AdminDoorControl; import handlers.admincommandhandlers.AdminEditChar; @@ -405,6 +406,7 @@ public class MasterHandler AdminCreateItem.class, AdminCursedWeapons.class, AdminDelete.class, + AdminDestroyItems.class, AdminDisconnect.class, AdminDoorControl.class, AdminEditChar.class, diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java new file mode 100644 index 0000000000..105a8eb1d3 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java @@ -0,0 +1,61 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.admincommandhandlers; + +import com.l2jmobius.gameserver.handler.IAdminCommandHandler; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.itemcontainer.PcInventory; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; + +/** + * @author Mobius + */ +public class AdminDestroyItems implements IAdminCommandHandler +{ + private static final String[] ADMIN_COMMANDS = + { + "admin_destroy_items", + "admin_destroy_all_items", + "admin_destroyitems", + "admin_destroyallitems" + }; + + @Override + public boolean useAdminCommand(String command, L2PcInstance activeChar) + { + final PcInventory inventory = activeChar.getInventory(); + final InventoryUpdate iu = new InventoryUpdate(); + for (L2ItemInstance item : inventory.getItems()) + { + if (item.isEquipped() && !command.contains("all")) + { + continue; + } + iu.addRemovedItem(item); + inventory.destroyItem("Admin Destroy", item, activeChar, null); + } + activeChar.sendPacket(iu); + return true; + } + + @Override + public String[] getAdminCommandList() + { + return ADMIN_COMMANDS; + } +} diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/AdminCommands.xml b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/AdminCommands.xml index 876a4afa34..27a86bc015 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/AdminCommands.xml +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/AdminCommands.xml @@ -96,6 +96,12 @@ + + + + + + diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/MasterHandler.java index 8f5af6190c..df58d04db2 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/MasterHandler.java @@ -69,6 +69,7 @@ import handlers.admincommandhandlers.AdminClanHall; import handlers.admincommandhandlers.AdminCreateItem; import handlers.admincommandhandlers.AdminCursedWeapons; import handlers.admincommandhandlers.AdminDelete; +import handlers.admincommandhandlers.AdminDestroyItems; import handlers.admincommandhandlers.AdminDisconnect; import handlers.admincommandhandlers.AdminDoorControl; import handlers.admincommandhandlers.AdminEditChar; @@ -405,6 +406,7 @@ public class MasterHandler AdminCreateItem.class, AdminCursedWeapons.class, AdminDelete.class, + AdminDestroyItems.class, AdminDisconnect.class, AdminDoorControl.class, AdminEditChar.class, diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java new file mode 100644 index 0000000000..105a8eb1d3 --- /dev/null +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java @@ -0,0 +1,61 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.admincommandhandlers; + +import com.l2jmobius.gameserver.handler.IAdminCommandHandler; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.itemcontainer.PcInventory; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; + +/** + * @author Mobius + */ +public class AdminDestroyItems implements IAdminCommandHandler +{ + private static final String[] ADMIN_COMMANDS = + { + "admin_destroy_items", + "admin_destroy_all_items", + "admin_destroyitems", + "admin_destroyallitems" + }; + + @Override + public boolean useAdminCommand(String command, L2PcInstance activeChar) + { + final PcInventory inventory = activeChar.getInventory(); + final InventoryUpdate iu = new InventoryUpdate(); + for (L2ItemInstance item : inventory.getItems()) + { + if (item.isEquipped() && !command.contains("all")) + { + continue; + } + iu.addRemovedItem(item); + inventory.destroyItem("Admin Destroy", item, activeChar, null); + } + activeChar.sendPacket(iu); + return true; + } + + @Override + public String[] getAdminCommandList() + { + return ADMIN_COMMANDS; + } +} diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/AdminCommands.xml b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/AdminCommands.xml index 876a4afa34..27a86bc015 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/AdminCommands.xml +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/AdminCommands.xml @@ -96,6 +96,12 @@ + + + + + + diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/MasterHandler.java index 8f5af6190c..df58d04db2 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/MasterHandler.java @@ -69,6 +69,7 @@ import handlers.admincommandhandlers.AdminClanHall; import handlers.admincommandhandlers.AdminCreateItem; import handlers.admincommandhandlers.AdminCursedWeapons; import handlers.admincommandhandlers.AdminDelete; +import handlers.admincommandhandlers.AdminDestroyItems; import handlers.admincommandhandlers.AdminDisconnect; import handlers.admincommandhandlers.AdminDoorControl; import handlers.admincommandhandlers.AdminEditChar; @@ -405,6 +406,7 @@ public class MasterHandler AdminCreateItem.class, AdminCursedWeapons.class, AdminDelete.class, + AdminDestroyItems.class, AdminDisconnect.class, AdminDoorControl.class, AdminEditChar.class, diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java new file mode 100644 index 0000000000..105a8eb1d3 --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java @@ -0,0 +1,61 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.admincommandhandlers; + +import com.l2jmobius.gameserver.handler.IAdminCommandHandler; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.itemcontainer.PcInventory; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; + +/** + * @author Mobius + */ +public class AdminDestroyItems implements IAdminCommandHandler +{ + private static final String[] ADMIN_COMMANDS = + { + "admin_destroy_items", + "admin_destroy_all_items", + "admin_destroyitems", + "admin_destroyallitems" + }; + + @Override + public boolean useAdminCommand(String command, L2PcInstance activeChar) + { + final PcInventory inventory = activeChar.getInventory(); + final InventoryUpdate iu = new InventoryUpdate(); + for (L2ItemInstance item : inventory.getItems()) + { + if (item.isEquipped() && !command.contains("all")) + { + continue; + } + iu.addRemovedItem(item); + inventory.destroyItem("Admin Destroy", item, activeChar, null); + } + activeChar.sendPacket(iu); + return true; + } + + @Override + public String[] getAdminCommandList() + { + return ADMIN_COMMANDS; + } +} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/AdminCommands.xml b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/AdminCommands.xml index 876a4afa34..27a86bc015 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/AdminCommands.xml +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/AdminCommands.xml @@ -96,6 +96,12 @@ + + + + + + diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/MasterHandler.java index 8f5af6190c..df58d04db2 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/MasterHandler.java @@ -69,6 +69,7 @@ import handlers.admincommandhandlers.AdminClanHall; import handlers.admincommandhandlers.AdminCreateItem; import handlers.admincommandhandlers.AdminCursedWeapons; import handlers.admincommandhandlers.AdminDelete; +import handlers.admincommandhandlers.AdminDestroyItems; import handlers.admincommandhandlers.AdminDisconnect; import handlers.admincommandhandlers.AdminDoorControl; import handlers.admincommandhandlers.AdminEditChar; @@ -405,6 +406,7 @@ public class MasterHandler AdminCreateItem.class, AdminCursedWeapons.class, AdminDelete.class, + AdminDestroyItems.class, AdminDisconnect.class, AdminDoorControl.class, AdminEditChar.class, diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java new file mode 100644 index 0000000000..105a8eb1d3 --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/admincommandhandlers/AdminDestroyItems.java @@ -0,0 +1,61 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.admincommandhandlers; + +import com.l2jmobius.gameserver.handler.IAdminCommandHandler; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.itemcontainer.PcInventory; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; + +/** + * @author Mobius + */ +public class AdminDestroyItems implements IAdminCommandHandler +{ + private static final String[] ADMIN_COMMANDS = + { + "admin_destroy_items", + "admin_destroy_all_items", + "admin_destroyitems", + "admin_destroyallitems" + }; + + @Override + public boolean useAdminCommand(String command, L2PcInstance activeChar) + { + final PcInventory inventory = activeChar.getInventory(); + final InventoryUpdate iu = new InventoryUpdate(); + for (L2ItemInstance item : inventory.getItems()) + { + if (item.isEquipped() && !command.contains("all")) + { + continue; + } + iu.addRemovedItem(item); + inventory.destroyItem("Admin Destroy", item, activeChar, null); + } + activeChar.sendPacket(iu); + return true; + } + + @Override + public String[] getAdminCommandList() + { + return ADMIN_COMMANDS; + } +}