Hello folks,
Index:net.sf.l2j.gameserver.handlers.[b]voicecommandhandlers[/b]
========================================================
/*
* 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 handlers.voicedcommandhandlers;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
/**
*
*@author Jve
*
*/
public class Pvp implements IVoicedCommandHandler
{
private static final String[] VOICED_COMMANDS = { "pvp" };
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{
if (command.equalsIgnoreCase("pvp"))
{
if(activeChar.isInJail())
{
activeChar.sendMessage("Sorry, you cant use this command,you are in Jail");
return false;
}
else if(activeChar.isInOlympiadMode())
{
activeChar.sendMessage("Sorry,you cant use this command,you are in the Olympiad now");
return false;
}
else if(activeChar.atEvent)
{
activeChar.sendMessage("Sorry,you cant use this command,you are in an event");
return false;
}
else if (activeChar.isInDuel())
{
activeChar.sendMessage("Sorry,you cant use this command,you are in a duel");
return false;
}
else if (activeChar.inObserverMode())
{
activeChar.sendMessage("Sorry,you cant use this command,you are in the observation.");
return false;
}
activeChar.teleToLocation(your X, your y, your Z);
activeChar.sendMessage("You have been teleported to PvP zone");
}
return true;
}
public String[] getVoicedCommandList()
{
return VOICED_COMMANDS;
}
}
Index:net.sf.l2j.gameserver.gameserver.Java
==========================================
+import net.sf.l2j.gameserver.handler.voicedcommandhandlers.pvp;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Wedding;
_voicedCommandHandler.registerVoicedCommandHandler(new Banking());
+_voicedCommandHandler.registerVoicedCommandHandler(new pvp());
Note:I did this share according to TheEnd's guide
you just press .pvp and it teleports you to your locations(actually you have to put your pvp locations to be nice),as you can see it has restrictions.
Thats all,
I know its pretty pretty simple to make something like that,but ok someone maybe need it for his server.