- 0
-
Registre-se
Faça parte da maior e mais antigas comunidades sobre Lineage2 da América Latina.
- Entre
- ou
- Cadastre-se
-
Quem Está Navegando
- Nenhum usuário registrado visualizando esta página.
-
Posts
-
Por Gabrieljdb · Postado
Falta arquivo "armorgrp.dat" alguém poderia postar. Grato! -
Também to querendo só a textura do drop no chão, se alguém tiver.
-
Opa Obrigado amigo e aguarde que vamos tentar por todas as quests 99,9% funcional principalemnte porque projeto acis nao vi ate agora com quest 90%
-
Por Saimon Cordeiro · Postado
Boa noite, estimado amigo! Sou entusiasta de servidores Low Raste e vou testar as missões do projeto, começando pelas classes de nível 20 de todas as raças. Desde já, expresso minha gratidão pelo suporte e pelo empreendimento. -
Por otaviodeyvison · Postado
Zonas em Vermelho - Mapas de upgrades de outras crônicas por isso nao esta disponivel nesse pack de download. Link Download: O conteúdo está oculto, favor efetuar login ou se cadastrar! Entre ou Cadastre-se -
Por otaviodeyvison · Postado
- Aqui esta listado todas as quests - conforme os infos disponíveis, no qual podemos testar as quests: -
Ola amigo no caso sua duvida sobre a lucera tem que ser feita na area oficial do projeto. Segue o link da area. Dúvidas - L2JBrasil - A Maior e mais antiga Comunidade de Lineage 2 da América Latina
-
Por zoidegato22 · Postado
boa Kelvin, eu tenho essa Rev lucera , voce poderia tira uma informação, so 1 duvida, pois eu coloco na Config de logar 2 char por HWID , nao funciona, só funciona o po IP, poderia me tira essa duvida.
-
Pergunta
TeacherOfJava
Boa tarde primeiramente. adicionei código .online e fiz todo processo. mas na hora de dale o comando aparece nome do personagem em vez de quantidades em números de players. Alguém por favor.
Codigo Usado
### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/handler/IVoicedCommandHandler.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/IVoicedCommandHandler.java (revision 0)
+++ java/net/sf/l2j/gameserver/handler/IVoicedCommandHandler.java (working copy)
@@ -0,0 +1,24 @@
+/*
+ * 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 mor
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see .
+ */
+package net.sf.l2j.gameserver.handler;
+
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+
+public interface IVoicedCommandHandler
+{
+ public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params);
+
+ public String[] getVoicedCommandList();
+}
\ No newline at end of file
Index: java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java (revision 1)
+++ java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java (working copy)
@@ -14,7 +14,11 @@
*/
package net.sf.l2j.gameserver.handler.chathandlers;
+import java.util.StringTokenizer;
+
import net.sf.l2j.gameserver.handler.IChatHandler;
+import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
+import net.sf.l2j.gameserver.handler.VoicedCommandHandler;
import net.sf.l2j.gameserver.model.BlockList;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
@@ -37,15 +41,43 @@
@Override
public void handleChat(int type, L2PcInstance activeChar, String params, String text)
{
- CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
+ boolean vcd_used = false;
+ if (text.startsWith("."))
+ {
+ StringTokenizer st = new StringTokenizer(text);
+ IVoicedCommandHandler vch;
+ String command = "";
- for (L2PcInstance player : activeChar.getKnownList().getKnownTypeInRadius(L2PcInstance.class, 1250))
+ if (st.countTokens() > 1)
+ {
+ command = st.nextToken().substring(1);
+ params = text.substring(command.length() + 2);
+ vch = VoicedCommandHandler.getInstance().getHandler(command);
+ }
+ else
+ {
+ command = text.substring(1);
+ vch = VoicedCommandHandler.getInstance().getHandler(command);
+ }
+
+ if (vch != null)
+ {
+ vch.useVoicedCommand(command, activeChar, params);
+ vcd_used = true;
+ }
+ }
+ if (!vcd_used)
{
- if (!BlockList.isBlocked(player, activeChar))
- player.sendPacket(cs);
- }
-
- activeChar.sendPacket(cs);
+ CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
+
+ for (L2PcInstance player : activeChar.getKnownList().getKnownTypeInRadius(L2PcInstance.class, 1250))
+ {
+ if (!BlockList.isBlocked(player, activeChar))
+ player.sendPacket(cs);
+ }
+
+ activeChar.sendPacket(cs);
+ }
}
/**
Index: java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- java/net/sf/l2j/gameserver/GameServer.java (revision 1)
+++ java/net/sf/l2j/gameserver/GameServer.java (working copy)
@@ -63,6 +63,7 @@
import net.sf.l2j.gameserver.handler.ItemHandler;
import net.sf.l2j.gameserver.handler.SkillHandler;
import net.sf.l2j.gameserver.handler.UserCommandHandler;
+import net.sf.l2j.gameserver.handler.VoicedCommandHandler;
import net.sf.l2j.gameserver.idfactory.IdFactory;
import net.sf.l2j.gameserver.instancemanager.AuctionManager;
import net.sf.l2j.gameserver.instancemanager.BoatManager;
@@ -275,7 +276,8 @@
_log.config("ItemHandler: Loaded " + ItemHandler.getInstance().size() + " handlers.");
_log.config("SkillHandler: Loaded " + SkillHandler.getInstance().size() + " handlers.");
_log.config("UserCommandHandler: Loaded " + UserCommandHandler.getInstance().size() + " handlers.");
-
+ _log.config("VoicedCommandHandler: Loaded " + VoicedCommandHandler.getInstance().size() + " handlers.");
+
if (Config.ALLOW_WEDDING)
CoupleManager.getInstance();
Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java (revision 0)
+++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java (working copy)
@@ -0,0 +1,42 @@
+/*
+ * 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 net.sf.l2j.gameserver.handler.voicedcommandhandlers;
+
+import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
+import net.sf.l2j.gameserver.model.L2World;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+
+public class Online implements IVoicedCommandHandler
+{
+ private static final String[] _voicedCommands = {"online"};
+
+ @Override
+ public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+ {
+ if (command.equals("online"))
+ {
+ activeChar.sendMessage("====[Online Players]====");
+ activeChar.sendMessage("Player(s): " + L2World.getInstance().getAllPlayersCount() + " Online.");
+ activeChar.sendMessage("======[L2jFanatic]======");
+ }
+ return true;
+ }
+
+ @Override
+ public String[] getVoicedCommandList()
+ {
+ return _voicedCommands;
+ }
+}
\ No newline at end of file
Index: java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java (revision 0)
+++ java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java (working copy)
@@ -0,0 +1,64 @@
+/*
+ * 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 net.sf.l2j.gameserver.handler;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Online;
+
+public class VoicedCommandHandler
+{
+ private final Map _datatable = new HashMap<>();
+
+ public static VoicedCommandHandler getInstance()
+ {
+ return SingletonHolder._instance;
+ }
+
+ protected VoicedCommandHandler()
+ {
+ // coloque aqui os comandos
+ registerHandler(new Online());
+ }
+
+ public void registerHandler(IVoicedCommandHandler handler)
+ {
+ String[] ids = handler.getVoicedCommandList();
+
+ for (int i = 0; i < ids.length; i++)
+ _datatable.put(ids.hashCode(), handler);
+ }
+
+ public IVoicedCommandHandler getHandler(String voicedCommand)
+ {
+ String command = voicedCommand;
+
+ if (voicedCommand.indexOf(" ") != -1)
+ command = voicedCommand.substring(0, voicedCommand.indexOf(" "));
+
+ return _datatable.get(command.hashCode());
+ }
+
+ public int size()
+ {
+ return _datatable.size();
+ }
+
+ private static class SingletonHolder
+ {
+ protected static final VoicedCommandHandler _instance = new VoicedCommandHandler();
+ }
+}
\ No newline at end of file
,
Editado por powergamesLink para o comentário
Compartilhar em outros sites
11 respostass a esta questão
Posts recomendados
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.