All pastes #334806 Raw Edit

Unnamed

public java v1 · immutable
#334806 ·published 2007-01-31 21:51 UTC
rendered paste body
/* * 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 */package net.sf.l2j.gameserver.handler.voicedcommandhandlers;import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;/** * This class deals with Gold Bars for 500kk adena... :) *  * @version $Revision: 1.0 $ $Date: 17:48 31-1-07 $ * @author  AresXP */public class Custom implements IVoicedCommandHandler{    private static String[] _voicedCommands = { "goldbar" };    public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)    {        if(command.equalsIgnoreCase("goldbar"))        {            if (activeChar.getInventory().getInventoryItemCount(57, 0) > 500000000)            {                activeChar.getInventory().reduceAdena("Goldbar", 500000000, activeChar, null);                activeChar.getInventory().addItem("Goldbar", 2807, 1, activeChar, null);                activeChar.sendMessage("Thank you, you've earned one gold bar");            } else {                activeChar.sendMessage("You do not have enough adena! You need five-hundred million adena.");            }        }        return true;    }    public String[] getVoicedCommandList()    {        return _voicedCommands;    }}