Other Target Related Actions:
diff --git a/L2J_Mobius_CT_0_Interlude/dist/game/data/html/admin/search.htm b/L2J_Mobius_CT_0_Interlude/dist/game/data/html/admin/search.htm
new file mode 100644
index 0000000000..2e2f1499ad
--- /dev/null
+++ b/L2J_Mobius_CT_0_Interlude/dist/game/data/html/admin/search.htm
@@ -0,0 +1,27 @@
+Admin Item Search
+
+
+
+
Search:
+
+
+
+
+
+
+
+
Id:
+
+
Qty:
+
+
+
+
+
+
+ %items%
+
+
+
Page: %pages%
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_CT_0_Interlude/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_CT_0_Interlude/dist/game/data/scripts/handlers/MasterHandler.java
index 75f100383f..f133e2b287 100644
--- a/L2J_Mobius_CT_0_Interlude/dist/game/data/scripts/handlers/MasterHandler.java
+++ b/L2J_Mobius_CT_0_Interlude/dist/game/data/scripts/handlers/MasterHandler.java
@@ -112,6 +112,7 @@ import handlers.admincommandhandlers.AdminRepairChar;
import handlers.admincommandhandlers.AdminRes;
import handlers.admincommandhandlers.AdminRide;
import handlers.admincommandhandlers.AdminScan;
+import handlers.admincommandhandlers.AdminSearch;
import handlers.admincommandhandlers.AdminServerInfo;
import handlers.admincommandhandlers.AdminShop;
import handlers.admincommandhandlers.AdminShowQuests;
@@ -394,6 +395,7 @@ public class MasterHandler
AdminRes.class,
AdminRide.class,
AdminScan.class,
+ AdminSearch.class,
AdminServerInfo.class,
AdminShop.class,
AdminShowQuests.class,
diff --git a/L2J_Mobius_CT_0_Interlude/dist/game/data/scripts/handlers/admincommandhandlers/AdminSearch.java b/L2J_Mobius_CT_0_Interlude/dist/game/data/scripts/handlers/admincommandhandlers/AdminSearch.java
new file mode 100644
index 0000000000..05c03a94d8
--- /dev/null
+++ b/L2J_Mobius_CT_0_Interlude/dist/game/data/scripts/handlers/admincommandhandlers/AdminSearch.java
@@ -0,0 +1,199 @@
+/*
+ * 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 java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.l2jmobius.commons.util.StringUtil;
+import org.l2jmobius.gameserver.data.ItemTable;
+import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.model.item.ItemTemplate;
+import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
+import org.l2jmobius.gameserver.util.MathUtil;
+
+/**
+ * @author CostyKiller
+ */
+public class AdminSearch implements IAdminCommandHandler
+{
+ private static final int PAGE_LIMIT = 15;
+
+ private static final String[] ADMIN_COMMANDS =
+ {
+ "admin_search"
+ };
+
+ @Override
+ public boolean useAdminCommand(String command, Player activeChar)
+ {
+ if (command.startsWith("admin_search"))
+ {
+ final StringTokenizer st = new StringTokenizer(command, " ");
+ st.nextToken();
+ if (!st.hasMoreTokens())
+ {
+ final NpcHtmlMessage html = new NpcHtmlMessage(0);
+ html.setFile(activeChar, "data/html/admin/search.htm");
+ html.replace("%items%", "");
+ html.replace("%pages%", "");
+ activeChar.sendPacket(html);
+ }
+ else
+ {
+ final String item = st.nextToken();
+ int page = 1;
+ if (st.hasMoreTokens())
+ {
+ try
+ {
+ page = Integer.parseInt(st.nextToken());
+ }
+ catch (NumberFormatException e)
+ {
+ page = 1;
+ }
+ }
+ results(activeChar, item, page);
+ }
+ }
+ return true;
+ }
+
+ private void results(Player player, String text, int page)
+ {
+ final NpcHtmlMessage html = new NpcHtmlMessage(0);
+ html.setFile(player, "data/html/admin/search.htm");
+
+ List items = new ArrayList<>();
+ for (ItemTemplate itemName : ItemTable.getInstance().getAllItems())
+ {
+ if ((itemName != null) && itemName.getName().toLowerCase().contains(text.toLowerCase()))
+ {
+ items.add(itemName);
+ }
+ }
+
+ if (items.isEmpty())
+ {
+ html.replace("%items%", "
No items found with word " + text + ".
");
+ html.replace("%pages%", "");
+ player.sendPacket(html);
+ return;
+ }
+
+ final int max = Math.min(100, MathUtil.countPagesNumber(items.size(), PAGE_LIMIT));
+ items = items.subList((page - 1) * PAGE_LIMIT, Math.min(page * PAGE_LIMIT, items.size()));
+
+ final StringBuilder sb = new StringBuilder();
+ for (ItemTemplate item : items)
+ {
+ StringUtil.append(sb, "
+
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/MasterHandler.java
index 2f077430a3..3baa8cfcf4 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/MasterHandler.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/MasterHandler.java
@@ -115,6 +115,7 @@ import handlers.admincommandhandlers.AdminRepairChar;
import handlers.admincommandhandlers.AdminRes;
import handlers.admincommandhandlers.AdminRide;
import handlers.admincommandhandlers.AdminScan;
+import handlers.admincommandhandlers.AdminSearch;
import handlers.admincommandhandlers.AdminServerInfo;
import handlers.admincommandhandlers.AdminShop;
import handlers.admincommandhandlers.AdminShowQuests;
@@ -413,6 +414,7 @@ public class MasterHandler
AdminRes.class,
AdminRide.class,
AdminScan.class,
+ AdminSearch.class,
AdminServerInfo.class,
AdminShop.class,
AdminShowQuests.class,
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/admincommandhandlers/AdminSearch.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/admincommandhandlers/AdminSearch.java
new file mode 100644
index 0000000000..e07f641ee9
--- /dev/null
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/admincommandhandlers/AdminSearch.java
@@ -0,0 +1,199 @@
+/*
+ * 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 java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.l2jmobius.commons.util.StringUtil;
+import org.l2jmobius.gameserver.data.ItemTable;
+import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.model.item.ItemTemplate;
+import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
+import org.l2jmobius.gameserver.util.MathUtil;
+
+/**
+ * @author CostyKiller
+ */
+public class AdminSearch implements IAdminCommandHandler
+{
+ private static final int PAGE_LIMIT = 15;
+
+ private static final String[] ADMIN_COMMANDS =
+ {
+ "admin_search"
+ };
+
+ @Override
+ public boolean useAdminCommand(String command, Player activeChar)
+ {
+ if (command.startsWith("admin_search"))
+ {
+ final StringTokenizer st = new StringTokenizer(command, " ");
+ st.nextToken();
+ if (!st.hasMoreTokens())
+ {
+ final NpcHtmlMessage html = new NpcHtmlMessage(0);
+ html.setFile(activeChar, "data/html/admin/search.htm");
+ html.replace("%items%", "");
+ html.replace("%pages%", "");
+ activeChar.sendPacket(html);
+ }
+ else
+ {
+ final String item = st.nextToken();
+ int page = 1;
+ if (st.hasMoreTokens())
+ {
+ try
+ {
+ page = Integer.parseInt(st.nextToken());
+ }
+ catch (NumberFormatException e)
+ {
+ page = 1;
+ }
+ }
+ results(activeChar, item, page);
+ }
+ }
+ return true;
+ }
+
+ private void results(Player player, String text, int page)
+ {
+ final NpcHtmlMessage html = new NpcHtmlMessage(0);
+ html.setFile(player, "data/html/admin/search.htm");
+
+ List items = new ArrayList<>();
+ for (ItemTemplate itemName : ItemTable.getInstance().getAllItems())
+ {
+ if ((itemName != null) && itemName.getName().toLowerCase().contains(text.toLowerCase()))
+ {
+ items.add(itemName);
+ }
+ }
+
+ if (items.isEmpty())
+ {
+ html.replace("%items%", "
No items found with word " + text + ".
");
+ html.replace("%pages%", "");
+ player.sendPacket(html);
+ return;
+ }
+
+ final int max = Math.min(100, MathUtil.countPagesNumber(items.size(), PAGE_LIMIT));
+ items = items.subList((page - 1) * PAGE_LIMIT, Math.min(page * PAGE_LIMIT, items.size()));
+
+ final StringBuilder sb = new StringBuilder();
+ for (ItemTemplate item : items)
+ {
+ StringUtil.append(sb, "
+
\ No newline at end of file
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 58a2af691d..f5a9839478 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
@@ -115,6 +115,7 @@ import handlers.admincommandhandlers.AdminRepairChar;
import handlers.admincommandhandlers.AdminRes;
import handlers.admincommandhandlers.AdminRide;
import handlers.admincommandhandlers.AdminScan;
+import handlers.admincommandhandlers.AdminSearch;
import handlers.admincommandhandlers.AdminServerInfo;
import handlers.admincommandhandlers.AdminShop;
import handlers.admincommandhandlers.AdminShowQuests;
@@ -414,6 +415,7 @@ public class MasterHandler
AdminRes.class,
AdminRide.class,
AdminScan.class,
+ AdminSearch.class,
AdminServerInfo.class,
AdminShop.class,
AdminShowQuests.class,
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminSearch.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminSearch.java
new file mode 100644
index 0000000000..e07f641ee9
--- /dev/null
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminSearch.java
@@ -0,0 +1,199 @@
+/*
+ * 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 java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.l2jmobius.commons.util.StringUtil;
+import org.l2jmobius.gameserver.data.ItemTable;
+import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.model.item.ItemTemplate;
+import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
+import org.l2jmobius.gameserver.util.MathUtil;
+
+/**
+ * @author CostyKiller
+ */
+public class AdminSearch implements IAdminCommandHandler
+{
+ private static final int PAGE_LIMIT = 15;
+
+ private static final String[] ADMIN_COMMANDS =
+ {
+ "admin_search"
+ };
+
+ @Override
+ public boolean useAdminCommand(String command, Player activeChar)
+ {
+ if (command.startsWith("admin_search"))
+ {
+ final StringTokenizer st = new StringTokenizer(command, " ");
+ st.nextToken();
+ if (!st.hasMoreTokens())
+ {
+ final NpcHtmlMessage html = new NpcHtmlMessage(0);
+ html.setFile(activeChar, "data/html/admin/search.htm");
+ html.replace("%items%", "");
+ html.replace("%pages%", "");
+ activeChar.sendPacket(html);
+ }
+ else
+ {
+ final String item = st.nextToken();
+ int page = 1;
+ if (st.hasMoreTokens())
+ {
+ try
+ {
+ page = Integer.parseInt(st.nextToken());
+ }
+ catch (NumberFormatException e)
+ {
+ page = 1;
+ }
+ }
+ results(activeChar, item, page);
+ }
+ }
+ return true;
+ }
+
+ private void results(Player player, String text, int page)
+ {
+ final NpcHtmlMessage html = new NpcHtmlMessage(0);
+ html.setFile(player, "data/html/admin/search.htm");
+
+ List items = new ArrayList<>();
+ for (ItemTemplate itemName : ItemTable.getInstance().getAllItems())
+ {
+ if ((itemName != null) && itemName.getName().toLowerCase().contains(text.toLowerCase()))
+ {
+ items.add(itemName);
+ }
+ }
+
+ if (items.isEmpty())
+ {
+ html.replace("%items%", "
No items found with word " + text + ".
");
+ html.replace("%pages%", "");
+ player.sendPacket(html);
+ return;
+ }
+
+ final int max = Math.min(100, MathUtil.countPagesNumber(items.size(), PAGE_LIMIT));
+ items = items.subList((page - 1) * PAGE_LIMIT, Math.min(page * PAGE_LIMIT, items.size()));
+
+ final StringBuilder sb = new StringBuilder();
+ for (ItemTemplate item : items)
+ {
+ StringUtil.append(sb, "