|
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 |
|
|||||||
| Registrar | Loteria VIP | Staff SE | Regras do fórum | Comunidade | Arcade | Postados Hoje | Pesquisar | Experience |
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
![]() |
|
|
LinkBack | Ferramentas do Tópico | Modos de Exibição |
|
|
#1 (permalink) | ||||||||||||||
|
Amigo SE
![]() Registrado em: Dec 2008
Localização: São Paulo
Posts: 1,188
Agradeceu: 162
Agradecido 1,768 Vezes em 486 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
Meu Estado:
![]()
Nome Real: Victor
|
Este Mod habilita os comandos .tvtjoin, .ctfjoin, .tvtleave, .ctfleave, .tvtinfo & .ctfinfo. Feito para plataforma L2jEmu.
Vá na pasta gameserver/handler/voicedcommandhandlers e crie o arquivo TvTCmd.java Código:
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
/*
* 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.l2emu.gameserver.handler.voicedcommandhandlers;
import com.l2emu.gameserver.handler.IVoicedCommandHandler;
import com.l2emu.gameserver.instancemanager.ZoneManager;
import com.l2emu.gameserver.model.actor.instance.L2PcInstance;
import com.l2emu.gameserver.model.entity.events.TvT;
import com.l2emu.gameserver.model.zone.L2Zone;
import com.l2emu.gameserver.network.serverpackets.NpcHtmlMessage;
public class TvTCmd implements IVoicedCommandHandler
{
private static final String[] VOICED_COMMANDS = { "tvtjoin", "tvtleave", "tvtinfo" };
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{
if (command.startsWith("tvtjoin"))
{
JoinTvT(activeChar);
}
else if(command.startsWith("tvtleave"))
{
LeaveTvT(activeChar);
}
else if(command.startsWith("tvtinfo"))
{
TvTinfo(activeChar);
}
return true;
}
public String[] getVoicedCommandList()
{
return VOICED_COMMANDS;
}
public boolean JoinTvT (L2PcInstance activeChar)
{
if ( activeChar == null)
{
return false;
}
NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage( 0 );
if (!TvT._joining)
{
npcHtmlMessage.setHtml("<html><body>There is no TvT Event in progress.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if (TvT._joining && activeChar._inEventTvT)
{
npcHtmlMessage.setHtml("<html><body>You are already registered.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if ( activeChar.isCursedWeaponEquipped())
{
npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you are holding a Cursed Weapon.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if ( activeChar.isInOlympiadMode())
{
npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you are in Olympiad.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if ( activeChar.isInJail() || activeChar.isInsideZone(L2Zone.FLAG_JAIL)) //check if player is in jail
{
npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you are in Jail.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if (activeChar.getLevel() < TvT._minlvl)
{
npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you level is too low.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if (activeChar.getKarma() > 0)
{
npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you have Karma.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if (TvT._teleport || TvT._started)
{
npcHtmlMessage.setHtml("<html><body>TvT Event registration period is over.<br>You can't register now.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else
{
npcHtmlMessage.setHtml("<html><body>Your participation in the TvT event has been approved.<br>Prepare to kill your enemies.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
TvT.addPlayer(activeChar,"");
return false;
}
}
public boolean LeaveTvT (L2PcInstance activeChar)
{
if ( activeChar == null)
{
return false;
}
NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage( 0 );
if (!TvT._joining)
{
npcHtmlMessage.setHtml("<html><body>There is no TvT Event in progress.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if ((TvT._teleport || TvT._started) && activeChar._inEventTvT)
{
npcHtmlMessage.setHtml("<html><body>You can not leave now because TvT event has started.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if (TvT._joining && !activeChar._inEventTvT)
{
npcHtmlMessage.setHtml("<html><body>You aren't registered in the TvT Event.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else
{
npcHtmlMessage.setHtml("<html><body>Your participation in the TvT event has been removed.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
TvT.removePlayer(activeChar);
return true;
}
}
public boolean TvTinfo (L2PcInstance activeChar)
{
if ( activeChar == null)
{
return false;
}
NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage( 0 );
if (!TvT._joining)
{
npcHtmlMessage.setHtml("<html><body>There is no TvT Event in progress.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if (TvT._teleport || TvT._started)
{
npcHtmlMessage.setHtml("<html><body>I can't provide you this info.<br>Command available only in joining period.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else
{
if (TvT._playersShuffle.size() == 1)
{
npcHtmlMessage.setHtml("<html><body>There is " + TvT._playersShuffle.size() + " player participating in this event.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
}
else
{
npcHtmlMessage.setHtml("<html><body>There are " + TvT._playersShuffle.size() + " players participating in this event.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
}
return true;
}
}
}
Código:
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
/*
* 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.l2emu.gameserver.handler.voicedcommandhandlers;
import com.l2emu.gameserver.handler.IVoicedCommandHandler;
import com.l2emu.gameserver.instancemanager.ZoneManager;
import com.l2emu.gameserver.model.actor.instance.L2PcInstance;
import com.l2emu.gameserver.model.entity.events.CTF;
import com.l2emu.gameserver.model.zone.L2Zone;
import com.l2emu.gameserver.network.serverpackets.NpcHtmlMessage;
public class CTFCmd implements IVoicedCommandHandler
{
private static final String[] VOICED_COMMANDS = { "ctfjoin", "ctfleave", "ctfinfo" };
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{
if (command.startsWith("ctfjoin"))
{
JoinCTF(activeChar);
}
else if(command.startsWith("ctfleave"))
{
LeaveCTF(activeChar);
}
else if(command.startsWith("ctfinfo"))
{
CTFinfo(activeChar);
}
return true;
}
public String[] getVoicedCommandList()
{
return VOICED_COMMANDS;
}
public boolean JoinCTF (L2PcInstance activeChar)
{
if ( activeChar == null)
{
return false;
}
NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage( 0 );
if (!CTF._joining)
{
npcHtmlMessage.setHtml("<html><body>There is no CTF Event in progress.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if (CTF._joining && activeChar._inEventCTF)
{
npcHtmlMessage.setHtml("<html><body>You are already registered.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if ( activeChar.isCursedWeaponEquipped())
{
npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you are holding a Cursed Weapon.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if ( activeChar.isInOlympiadMode())
{
npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you are in Olympiad.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if ( activeChar.isInJail() || activeChar.isInsideZone(L2Zone.FLAG_JAIL)) //check if player is in jail
{
npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you are in Jail.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if (activeChar.getLevel() < CTF._minlvl)
{
npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you level is too low.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if (activeChar.getKarma() > 0)
{
npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you have Karma.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if (CTF._teleport || CTF._started)
{
npcHtmlMessage.setHtml("<html><body>CTF Event registration period is over.<br>You can't register now.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else
{
npcHtmlMessage.setHtml("<html><body>Your participation in the CTF event has been approved.<br>Prepare to kill your enemies.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
CTF.addPlayer(activeChar,"");
return false;
}
}
public boolean LeaveCTF (L2PcInstance activeChar)
{
if ( activeChar == null)
{
return false;
}
NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage( 0 );
if (!CTF._joining)
{
npcHtmlMessage.setHtml("<html><body>There is no CTF Event in progress.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if ((CTF._teleport || CTF._started) && activeChar._inEventCTF)
{
npcHtmlMessage.setHtml("<html><body>You can not leave now because CTF event has started.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if (CTF._joining && !activeChar._inEventCTF)
{
npcHtmlMessage.setHtml("<html><body>You aren't registered in the CTF Event.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else
{
npcHtmlMessage.setHtml("<html><body>Your participation in the CTF event has been removed.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
CTF.removePlayer(activeChar);
return true;
}
}
public boolean CTFinfo (L2PcInstance activeChar)
{
if ( activeChar == null)
{
return false;
}
NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage( 0 );
if (!CTF._joining)
{
npcHtmlMessage.setHtml("<html><body>There is no CTF Event in progress.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else if (CTF._teleport || CTF._started)
{
npcHtmlMessage.setHtml("<html><body>I can't provide you this info.<br>Command available only in joining period.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
return false;
}
else
{
if (CTF._playersShuffle.size() == 1)
{
npcHtmlMessage.setHtml("<html><body>There is " + CTF._playersShuffle.size() + " player participating in this event.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
}
else
{
npcHtmlMessage.setHtml("<html><body>There are " + CTF._playersShuffle.size() + " players participating in this event.</body></html>");
activeChar.sendPacket( npcHtmlMessage );
}
return true;
}
}
}
__________________
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] |
||||||||||||||
|
|
|||||||||||||||
| O seguinte membro ao lado disse Obrigado(a) a : KaL por gostar deste Post : |
felipe360 (08-07-2009)
|
| Links Patrocinados |
|
|
#2 (permalink) |
|
Banido
![]() Registrado em: Dec 2008
Posts: 52
Agradeceu: 54
Agradecido 62 Vezes em 9 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
|
Meu L2Emu tem o seguinte codigo no VoicedCommandHandler.java, como eu add o novo voiced?
Código PHP:
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
|
|
|
|
|
|
#3 (permalink) | ||||||||||||||
|
Amigo SE
![]() Registrado em: Dec 2008
Localização: São Paulo
Posts: 1,188
Agradeceu: 162
Agradecido 1,768 Vezes em 486 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
Meu Estado:
![]()
Nome Real: Victor
|
Perdão, foi um erro meu, adicionei coisa a mais aí! xD
Teste apenas com esta source, sem o VoicedCommandHandler.java modificado...veja se surtiu efeito nos comandos e dê um feed back...
__________________
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] |
||||||||||||||
|
|
|
||||||||||||||
|
|
#5 (permalink) |
|
Banido
![]() Registrado em: Jul 2009
Localização: Joinville
Posts: 376
Agradeceu: 221
Agradecido 529 Vezes em 111 Posts
Nome Real: Alan Douglas Silvestre Aldrique
|
Bom meu amigo nao so o criador mais vo responde mesmo assim ate da pra por em
l2j so que seria um bom trabalho e uma bela dor de cabeça por isso é plataforma L2jEmu. :D |
|
|
|
|
|
#6 (permalink) |
|
Membro - Capitão
![]() Registrado em: Mar 2009
Localização: Belo Horizonte - MG
Posts: 119
Agradeceu: 58
Agradecido 33 Vezes em 25 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
|
Da pra por em L2jServer sim. Vai dar mais trabalho que L2jEmu?
Com certeza... mas voce vai ter um PACK muito melhor. Pois veja bem, EMU, usa base L2jFree, que usa base L2JServer. Emu é um bosta, o cara so faz codigo pesado. S Se tu tem a manha de colocar adicionar os CODIGOS no java, vai JSERVER. Muito melhor pra tu! Vlws! |
|
|
|
|
|
#7 (permalink) |
|
Membro - Soldado
![]() Registrado em: Jul 2009
Posts: 10
Agradeceu: 0
Agradecido 0 Vezes em 0 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
|
Concordo com voce Vsl.
L2JServer é o melhor server, e L2JFree por usar a sua base também é muito bom. Reparei que a maioria das pessoas que falam mal dos packs L2JFree é porque nao tem o minimo conhecimento de java. Eu já uso esses comandos em meu server L2JFREE a muito tempo. Recomendo inserir manualmente isso no core, para evitar problemas. Ate + |
|
|
|
|
|
#9 (permalink) |
|
playstation
![]() Registrado em: Dec 2008
Localização: Belo Horizonte
Posts: 1,284
Agradeceu: 118
Agradecido 1,503 Vezes em 772 Posts
Nome Real: Marcelo
|
@felipe360, Java não se aprende com um Tutorial.
Procure no Google apostilas de Java ou uma faculdade.
__________________
Há! Só posso rir de quem quer vender o que mal sabe fazer... Quer ser respondido direito!? Não faça perguntas idiotas. (Y) |
|
|
|
![]() |
|
|