Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P aCis_gameserver
- Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Color.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Color.java (revision 0)
- +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Color.java (working copy)
- @@ -0,0 +1,78 @@
- +/* 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 2, 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, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +
- +/*
- + * - Color's ID -
- + *
- + * Black = 000000
- + * Red = FF0000
- + * Green = 00FF00
- + * Blue = 0000FF
- + * Yellow = FFFF00
- + *
- + */
- +
- +/**
- + * @author Crystalia
- + */
- +
- +package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
- +
- +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +
- +public class Color implements IVoicedCommandHandler
- +{
- + private static final String[] VOICED_COMMANDS = { "color", "clean" };
- +
- + @Override
- + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
- + {
- +
- + if (command.startsWith("color"))
- + {
- + try
- + {
- +
- + String val = command.substring(15);
- +
- + activeChar.getAppearance().setNameColor(Integer.decode("0x" + val));
- + activeChar.sendMessage("Congratulations, your name's color changed successfully!");
- + activeChar.broadcastUserInfo();
- + }
- + catch (Exception e)
- + {
- + activeChar.sendMessage("You need to specify a valid new color.");
- + }
- + }
- +
- + else if (command.startsWith("clean"))
- + {
- + activeChar.getAppearance().setNameColor(255, 255, 255);
- + activeChar.sendMessage("Your name's color cleaned.");
- + activeChar.broadcastUserInfo();
- + }
- +
- + return false;
- + }
- +
- + @Override
- + public String[] getVoicedCommandList()
- + {
- + return VOICED_COMMANDS;
- + }
- +
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java (revision 21)
- +++ java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java (working copy)
- @@ -23,6 +23,7 @@
- import javolution.util.FastMap;
- import net.sf.l2j.Config;
- +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Color;
- @@ -55,6 +56,8 @@
- }
- + registerVoicedCommandHandler(new Color());
- +
- }
- public void registerVoicedCommandHandler(IVoicedCommandHandler handler)
Advertisement
Add Comment
Please, Sign In to add comment