All pastes #346085 Raw Edit

Unnamed

public java v1 · immutable
·published 2007-02-09 01: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.2 $ $Date: 21:47 8-2-07 $ * @author AresXP -- 2007 */public class Custom implements IVoicedCommandHandler{    private static String[] _voicedCommands = { "bank", "withdraw", "deposit" };    public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)    {        if(command.equalsIgnoreCase("bank"))         {            activeChar.sendMessage(".deposit (500m->gb) / .withdraw (gb->500m)");        }        if(command.equalsIgnoreCase("deposit"))         {            if (activeChar.getInventory().getInventoryItemCount(57, 0) >= 500000000)            {                activeChar.getInventory().reduceAdena("Goldbar", 500000000, activeChar, null);                activeChar.getInventory().addItem("Goldbar", 3470, 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.");            }        }        if(command.equalsIgnoreCase("withdraw"))        {            if(activeChar.getInventory().getInventoryItemCount(3470, 0) >= 1) {                activeChar.getInventory().destroyItemByItemId("Adena", 3470, 1, activeChar, null);                activeChar.getInventory().addAdena("Adena", 500000000, activeChar, null);                activeChar.sendMessage("Thank you, you've earned 500 million adena");            } else {                activeChar.sendMessage("Doesn't work that way around here, need gold bars so pay up!");            }                    }        return true;    }    public String[] getVoicedCommandList()    {        return _voicedCommands;    }}