DS - News

Bem Vindo a DS - News


Participe do fórum, é rápido e fácil

DS - News

Bem Vindo a DS - News

DS - News

Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
DS - News



    [Java Mod] RatesINFO

    avatar
    Fundador
    [L2J] Owner
    [L2J] Owner


    Mensagens : 2
    Data de inscrição : 07/11/2010

      [Java Mod] RatesINFO   Empty [Java Mod] RatesINFO

    Mensagem por Fundador 7/11/2010, 17:37

    Core

    Arquivos .properties
    Código:
    # Allow .rates Command
    RatesCommand = False

    Arquivos Config.java
    Código:
    public static boolean ENABLE_RATES;

    ENABLE_RATES = Boolean.parseBoolean(VoicedCommand.getProperty("RatesCommand","False"));

    Arquivos Voicedcommandhadlers.java
    Código:
    import net.sf.l2j.gameserver.handler.voicedcommandhandlers.rates;

                    if (Config.ENABLE_RATES)
                    registerVoicedCommandHandler(new rates());

    Arquivo rates.java
    Código:

    /* 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 java.util.logging.Logger;

    import net.sf.l2j.gameserver.GameServer;
    import net.sf.l2j.gameserver.cache.HtmCache;
    import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
    import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
    import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
     
    /**
     * @author kkthnxbai
     *
     */
    public class rates implements IVoicedCommandHandler
    {
            private static final String[] VOICED_COMMANDS = {"rates"};

            private static final Logger _log = Logger.getLogger(GameServer.class.getName());
           
            public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
            {
                    if (command.equalsIgnoreCase("rates"))
                    {
                            String htmFile = "data/html/rates.htm";
                            String htmContent = HtmCache.getInstance().getHtm(htmFile);
                            if (htmContent != null)
                            {
                                    NpcHtmlMessage infoHtml = new NpcHtmlMessage(1);
                                    infoHtml.setHtml(htmContent);
                                    activeChar.sendPacket(infoHtml);
                            }
                            else
                            {
                                    activeChar.sendMessage("Function temporary disabled.");
                                    _log.info("Failed to load RatesInfos file!");
                            }
                            return true;
                    }
                    return false;
        }
           
            public String[] getVoicedCommandList()
            {
                    return VOICED_COMMANDS;
            }
    }

    DATA

    Arquivo rates.html
    Datapack\data\html

    Código:

    <html>
    <title>Informação sobre "RATES"</title>
    <body>
    <center><font color="LEVEL">Rates.</font><br><br>
    L2J PROJECT INTERLUDE.<br1>
    NÃO RETIRE NOSSOS CREDITOS.<br>
    <br>
    <center><font color="LEVEL">Developers.</font><br><br>
    Paulinho Souza.<br>
    <br>
    <br>
    </body>
    </html>

    Creditos: kkthnxbai

      Data/hora atual: 19/5/2024, 14:00