Você não é registrado, por favor registre-se para ter acesso ao conteúdo completo.
Caso seja registrado, efetue login.
Esqueceu sua senha? Clique aqui
Recomendamos o uso do Mozilla Firefox para uma melhor visualização.    


Início Postados Hoje Marcar Fóruns Como Lidos Álbums Banidos SE Team Medalhas
Voltar   Secret Experience > Área L2J > [L2J] Downloads > [Lineage] Java Mods
Registrar Loteria VIPStaff SERegras do fórum Comunidade Arcade Postados Hoje Pesquisar Experience
   

Secret Experience.NET   Secret Experience Corporation - Welcome To The Real World
     Anúncios SE

Resposta
 
LinkBack Ferramentas do Tópico Modos de Exibição
Antigo 30-10-2011, 03:16 AM   #1 (permalink)
Banido
 
Avatar de allanalcantara
 
Registrado em: Nov 2009
Localização: Fortaleza-ce
Posts: 325
Agradeceu: 125
Agradecido 203 Vezes em 82 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
Enviar mensagem via Windows Live Messenger para allanalcantara Enviar mensagem via Skype para allanalcantara
Nome Real: Allan Alcântara de Alencar

Inventório de allanalcantara

Padrão Create Itens System

Ele cria o Item para Todos os players online.
e Também remove todos os itens do inventory do Char.

Abraços, em breve estarei postando mais.
Código: [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
Index: head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminCreateItem.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminCreateItem.java	(revision 741)
+++ head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminCreateItem.java	(working copy)
@@ -19,11 +19,17 @@
 package com.l2jfrozen.gameserver.handler.admincommandhandlers;
 
 import java.util.StringTokenizer;
+import java.util.logging.Logger;
 
 import com.l2jfrozen.gameserver.datatables.sql.ItemTable;
 import com.l2jfrozen.gameserver.handler.IAdminCommandHandler;
+import com.l2jfrozen.gameserver.model.L2World;
+import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
 import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.network.SystemMessageId;
+import com.l2jfrozen.gameserver.network.serverpackets.InventoryUpdate;
 import com.l2jfrozen.gameserver.network.serverpackets.ItemList;
+import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
 import com.l2jfrozen.gameserver.templates.L2Item;
 
 /**
@@ -34,15 +40,18 @@
  */
 public class AdminCreateItem implements IAdminCommandHandler
 {
+	private static Logger _log = Logger.getLogger(AdminCreateItem.class.getName());
 	private static final String[] ADMIN_COMMANDS =
 	{
-			"admin_itemcreate", "admin_create_item"
+			"admin_itemcreate", "admin_create_item", "admin_mass_create", "admin_clear_inventory"
 	};
 
 	private enum CommandEnum
 	{
 		admin_itemcreate,
-		admin_create_item
+		admin_create_item,
+		admin_mass_create,
+		admin_clear_inventory
 	}
 
 	@Override
@@ -74,14 +83,15 @@
 		
 		switch(comm)
 		{
-			case admin_itemcreate:{
+			case admin_itemcreate:
+
 				AdminHelpPage.showHelpPage(activeChar, "itemcreation.htm");
 				return true;
-			}
+
 			case admin_create_item:
-				
-				if(st.hasMoreTokens()){
 
+				if(st.hasMoreTokens())
+				{
 					if(st.countTokens() == 2)
 					{
 						String id = st.nextToken();
@@ -130,16 +140,85 @@
 						}
 					}
 
-				}else{
-					
+				}
+				else
+				{					
 					AdminHelpPage.showHelpPage(activeChar, "itemcreation.htm");
 					//activeChar.sendMessage("Usage: //itemcreate <itemId> [amount]");
 					return true;
 				}
-				
-			default:{
 				return false;
-			}
+
+			case admin_mass_create:
+
+				if(st.hasMoreTokens())
+				{
+					if(st.countTokens() == 2)
+					{
+						String id = st.nextToken();
+						String num = st.nextToken();
+						
+						int idval = 0; 
+						int numval = 0;
+						
+						try
+						{
+							idval = Integer.parseInt(id);
+							numval = Integer.parseInt(num);
+						}
+						catch(NumberFormatException e)
+						{							
+							activeChar.sendMessage("Usage: //mass_create <itemId> <amount>");
+							return false;
+						}
+						
+						if(idval > 0 && numval > 0)
+						{
+							massCreateItem(activeChar, idval, numval);
+							return true;
+						}
+						else{
+							activeChar.sendMessage("Usage: //mass_create <itemId> <amount>");
+							return false;
+						}
+					}
+					else if(st.countTokens() == 1)
+					{
+						String id = st.nextToken();
+						int idval = 0; 
+						
+						try
+						{
+							idval = Integer.parseInt(id);
+						
+						}
+						catch(NumberFormatException e)
+						{							
+							activeChar.sendMessage("Usage: //mass_create <itemId> <amount>");
+							return false;
+						}
+
+						if(idval > 0)
+						{
+							massCreateItem(activeChar, idval, 1);
+							return true;
+						}
+						else
+						{
+							activeChar.sendMessage("Usage: //mass_create <itemId> <amount>");
+							return false;
+						}
+					}
+				}
+				return false;
+
+			case admin_clear_inventory:
+
+				removeAllItems(activeChar);
+				return true;
+
+			default:
+				return false;
 		}
 		
 	}
@@ -201,10 +280,52 @@
 		else
 		{
 			activeChar.sendMessage("You have spawned " + num + " item(s) number " + id + " in " + Player.getName() + "'s inventory.");
-			Player.sendMessage("Admin have spawned " + num + " item(s) number " + id + " in your inventory.");
+			Player.sendMessage("Admin has spawned " + num + " item(s) number " + id + " in your inventory.");
 		}
 
 		Player = null;
 		il = null;
 	}
+
+	private void massCreateItem(L2PcInstance activeChar, int id, int num)
+	{
+		if(num > 20)
+		{
+			L2Item template = ItemTable.getInstance().getTemplate(id);
+			if(template != null && !template.isStackable())
+			{
+				activeChar.sendMessage("This item does not stack - Creation aborted.");
+				return;
+			}
+		}
+
+		int i = 0;
+		L2ItemInstance item = null;
+		for(L2PcInstance player : L2World.getInstance().getAllPlayers())
+		{
+			player.sendMessage("Admin is rewarding all online players.");
+			item = player.getInventory().addItem("Admin", id, num, null, null);
+            InventoryUpdate iu = new InventoryUpdate();
+            iu.addItem(item);
+			player.sendPacket(iu);
+            SystemMessage sm = new SystemMessage(SystemMessageId.YOU_PICKED_UP_S1_S2);
+            sm.addItemName(item.getItemId());
+            sm.addNumber(num);
+            player.sendPacket(sm);
+			i++;
+		}
+		activeChar.sendMessage("Mass-created items in the inventory of " + i + " player(s).");
+		_log.info("GM " + activeChar.getName() + " mass_created " + item.getItemName() + " (" + num + ")");
+	}
+
+	private void removeAllItems(L2PcInstance activeChar)
+	{
+		for (L2ItemInstance item : activeChar.getInventory().getItems())
+		{
+			if(item.getLocation() == L2ItemInstance.ItemLocation.INVENTORY)
+				activeChar.getInventory().destroyItem("Destroy", item.getObjectId(), item.getCount(), activeChar, null);
+		}
+		activeChar.sendPacket(new ItemList(activeChar, false));
+		activeChar.sendMessage("Your inventory has been cleared.");
+ 	}
 }

Index: data/html/admin/itemcreation.htm
===================================================================
--- data/html/admin/itemcreation.htm	(revision 742)
+++ data/html/admin/itemcreation.htm	(working copy)
@@ -10,9 +10,10 @@
 <tr><td>Fill the ID number in item-id to create the item that</td></tr>
 <tr><td>you want, use amount if you need more than one.</td></tr>
 <tr><td><br></td></tr>
-<tr><td>Caution:</td></tr>
-<tr><td>Do not use amount with non-stackable items.</td></tr>
+<tr><td>Caution: Max amount for stackable items is 20</td></tr>
 <tr><td><br></td></tr>
+<tr><td>Use //mass_create to spawn items in every online character</td></tr>
+<tr><td><br></td></tr>
 </table>
 <center>
 <table>
@@ -21,10 +22,20 @@
 <td>Amount: <edit var="itemnum" width=50></td>
 <td>&nbsp;<button value="Create Item" action="bypass -h admin_create_item $itemid $itemnum" width=70 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
 </tr>
-</table>
-</center><br><br>
+<tr>
+<td><edit var="massitemid" width=50></td>
+<td><edit var="massitemnum" width=50></td>
+<td><button value="Mass Create" action="bypass -h admin_mass_create $massitemid $massitemnum" width=70 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
+</tr></table></center><br><br>
+<table width=270>
+<tr><td>Use //clear_inventory to delete all unequiped items in your inventory.</td></tr>
+</table><br>
 <center>
 <table>
+<tr><td>
+<button value="Clear Inventory" action="bypass -h admin_clear_inventory" width=95 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
+</tr>
+<tr><td><br></td></tr>
 <tr><td><center>Assets: <edit var="asset" width=70 height=11></center></td></tr>
 </table><br>
 <table>
Créditos : Frozen

allanalcantara está offline  
Links Patrocinados
Resposta


Regras para Posts
Você não pode postar novos tópicos
Você não pode postar respostas
Você não pode postar anexos
Você não pode editar seus posts

Código [IMG] Sim
Código HTML Não
Trackbacks are Sim
Pingbacks are Sim
Refbacks are Sim



Horários baseados na GMT -3. Agora são 07:22 AM.
 



Search Engine Optimization by vBSEO 3.3.0