Ir para conteúdo
  • Cadastre-se
  • 0

Remover Item do inventario do Player


mattmir

Pergunta

Então gente, vi esse mod, mas não posso usa-lo


Pois minha rev é Frozen 1132



ALGUEM PODERIA POR FAVOR ADAPTAR PRA MIM :buaa:


FICARIA MUITOOOO FELIZZZ





SERIOO!!! POR FAVOR



https://www.l2jbrasil.com/index.php?/topic/107810-remover-item-do-inventario-do-player/


Link para o comentário
Compartilhar em outros sites

12 respostass a esta questão

Posts recomendados

  • 0

Apareceu um monte de erros em varias linha! Se puder fazer um video pra mim ver, se sou eu q estou errando

Ta ai amigao, lembrando que voce tem que adicionar essa parte no seu datapack e compilar:

O conteúdo está oculto, favor efetuar login ou se cadastrar!

não ensinei no video pq eu tava sem a datapack da Frozen 1132:

Lineage 2 Lords

Link para o comentário
Compartilhar em outros sites


  • 0

 

Então gente, vi esse mod, mas não posso usa-lo

Pois minha rev é Frozen 1132

ALGUEM PODERIA POR FAVOR ADAPTAR PRA MIM :buaa:

FICARIA MUITOOOO FELIZZZ

SERIOO!!! POR FAVOR

https://www.l2jbrasil.com/index.php?/topic/107810-remover-item-do-inventario-do-player/

 

Mais na L2jFrozen 1132 ela funciona sim, nao precisa adaptar nada.

Lineage 2 Lords

Link para o comentário
Compartilhar em outros sites

  • 0

 

Então gente, vi esse mod, mas não posso usa-lo

Pois minha rev é Frozen 1132

ALGUEM PODERIA POR FAVOR ADAPTAR PRA MIM :buaa:

FICARIA MUITOOOO FELIZZZ

SERIOO!!! POR FAVOR

https://www.l2jbrasil.com/index.php?/topic/107810-remover-item-do-inventario-do-player/

 

 

Um dos meus projetos é a 1132, e adicionei e funcionou perfeitamente, verifique tudo o que fez, não pode ter nenhum erro, e deve configurar corretamente

neTiVFC.gif

9KuKwr5.gif

Link para o comentário
Compartilhar em outros sites

  • 0

 

Um dos meus projetos é a 1132, e adicionei e funcionou perfeitamente, verifique tudo o que fez, não pode ter nenhum erro, e deve configurar corretamente

Vou tentar adicionar dnv, caso der algum erro te falo pera ai

Link para o comentário
Compartilhar em outros sites

  • 0
 

Então gente, vi esse mod, mas não posso usa-lo

 

Pois minha rev é Frozen 1132

 

 

 

 

 

ALGUEM PODERIA POR FAVOR ADAPTAR PRA MIM :buaa:

 

 

FICARIA MUITOOOO FELIZZZ

 

 

 

 

 

 

 

 

 

 

 

SERIOO!!! POR FAVOR

 

 

 

 

 

https://www.l2jbrasil.com/index.php?/topic/107810-remover-item-do-inventario-do-player/

 

olá amigo vá para esse link 

xvitorx1 conseguiu adptar para a frozen 

 

 

### Eclipse Workspace Patch 1.0
#P L2jFrozen_GameServer
Index: head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminInventory.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminInventory.java    (revision 0)
+++ head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminInventory.java    (working copy)
@@ -0,0 +1,143 @@
/*
 * 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 <http://www.gnu.org/licenses/>.
 */
package com.l2jfrozen.gameserver.handler.admincommandhandlers;

import com.l2jfrozen.gameserver.handler.IAdminCommandHandler;
import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jfrozen.gameserver.util.Util;

/**
 * This class handles following admin commands:
 * <ul>
 * <li>show_ivetory</li>
 * <li>delete_item</li>
 * </ul>
 * @author Zealar
 */
public class AdminInventory implements IAdminCommandHandler
{
	private static final String[] ADMIN_COMMANDS =
	{
		"admin_show_inventory",
		"admin_delete_item"
	};
	
	@Override
	public boolean useAdminCommand(String command, L2PcInstance activeChar)
	{
		if ((activeChar.getTarget() == null))
		{
			activeChar.sendMessage("Select a target");
			return false;
		}
		
		if (!(activeChar.getTarget() instanceof L2PcInstance))
		{
			activeChar.sendMessage("Target need to be player");
			return false;
		}
		
		L2PcInstance player = activeChar.getTarget().getActingPlayer();
		
		if (command.startsWith(ADMIN_COMMANDS[0]))
		{
			if (command.length() > ADMIN_COMMANDS[0].length())
			{
				String com = command.substring(ADMIN_COMMANDS[0].length() + 1);
				if (Util.isDigit(com))
				{
					showItemsPage(activeChar, Integer.parseInt(com));
				}
			}
			
			else
			{
				showItemsPage(activeChar, 0);
			}
		}
		else if (command.contains(ADMIN_COMMANDS[1]))
		{
			String val = command.substring(ADMIN_COMMANDS[1].length() + 1);
			
			player.destroyItem("GM Destroy", Integer.parseInt(val), player.getInventory().getItemByObjectId(Integer.parseInt(val)).getCount(), null, true);
			showItemsPage(activeChar, 0);
		}
		
		return true;
	}
	
	private static void showItemsPage(L2PcInstance activeChar, int page)
	{
		final L2PcInstance target = activeChar.getTarget().getActingPlayer();
		
		final L2ItemInstance[] items = target.getInventory().getItems();
		
		int maxItemsPerPage = 16;
		int maxPages = items.length / maxItemsPerPage;
		if (items.length > (maxItemsPerPage * maxPages))
		{
			maxPages++;
		}
		
		if (page > maxPages)
		{
			page = maxPages;
		}
		
		int itemsStart = maxItemsPerPage * page;
		int itemsEnd = items.length;
		if ((itemsEnd - itemsStart) > maxItemsPerPage)
		{
			itemsEnd = itemsStart + maxItemsPerPage;
		}
		
		final NpcHtmlMessage adminReply = new NpcHtmlMessage(0);
		adminReply.setFile("data/html/admin/inventory.htm");
		adminReply.replace("%PLAYER_NAME%", target.getName());
		
		StringBuilder sbPages = new StringBuilder();
		for (int x = 0; x < maxPages; x++)
		{
			int pagenr = x + 1;
			sbPages.append("<td><button value=\"" + String.valueOf(pagenr) + "\" action=\"bypass -h admin_show_inventory " + String.valueOf(x) + "\" width=14 height=14 back=\"sek.cbui67\" fore=\"sek.cbui67\"></td>");
		}
		
		adminReply.replace("%PAGES%", sbPages.toString());
		
		StringBuilder sbItems = new StringBuilder();
		
		for (int i = itemsStart; i < itemsEnd; i++)
		{
			sbItems.append("<tr><td>" + items[i].getItem() + "</td>");
			sbItems.append("<td><button action=\"bypass -h admin_delete_item " + String.valueOf(items[i].getObjectId()) + "\" width=16 height=16 back=\"L2UI.bbs_delete\" fore=\"L2UI.bbs_delete\">" + "</td></tr>");
		}
		
		adminReply.replace("%ITEMS%", sbItems.toString());
		
		activeChar.sendPacket(adminReply);
	}
	
	@Override
	public String[] getAdminCommandList()
	{
		return ADMIN_COMMANDS;
	}
} 
\ No newline at end of file
Index: head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java    (revision 1118)
+++ head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java    (working copy)
@@ -58,6 +58,7 @@
 import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminGmChat;
 import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminHeal;
 import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminHelpPage;
+import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminInventory;
 import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminInvul;
 import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminKick;
 import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminKill;
@@ -187,6 +188,7 @@
         registerAdminCommandHandler(new AdminBuffs());
         registerAdminCommandHandler(new AdminAio());
         registerAdminCommandHandler(new AdminCharSupervision());
+        registerAdminCommandHandler(new AdminInventory());
         registerAdminCommandHandler(new AdminWho()); // L2OFF command
         // ATTENTION: adding new command handlers, you have to change the
         // sql file containing the access levels rights
Index: head-src/com/l2jfrozen/gameserver/util/Util.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/util/Util.java    (revision 1118)
+++ head-src/com/l2jfrozen/gameserver/util/Util.java    (working copy)
@@ -378,4 +378,25 @@
         return false;
     }
     
+    /**
+     * @param text - the text to check
+     * @return {@code true} if {@code text} contains only numbers, {@code false} otherwise
+     */
+    public static boolean isDigit(String text)
+    {
+        if ((text == null) || text.isEmpty())
+        {
+            return false;
+        }
+        for (char c : text.toCharArray())
+        {
+            if (!Character.isDigit(c))
+            {
+                return false;
+            }
+        }
+        return true;
+    }
+    
+    
 } 
Link para o comentário
Compartilhar em outros sites

  • 0
 

Ta ai amigao, lembrando que voce tem que adicionar essa parte no seu datapack e compilar:

O conteúdo está oculto, favor efetuar login ou se cadastrar!

não ensinei no video pq eu tava sem a datapack da Frozen 1132:

 

tem como você fazer isso no servidor onã? uma atualização dessas pra inicio de 2019 seria muito bom

 

Jadson kewin

Link para o comentário
Compartilhar em outros sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Processando...




×
×
  • Criar Novo...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.