Jump to content

[SHARE][GUIDE]How to Put .info Command for Info about your Server


Recommended Posts

Hello folks,

 

In this guide i will teach you how to put a new command named .info on your server and when u type it and hit enter it will show a htm file that there you can put w/e you want .. i suggest updates and info of server ..

 

so here we go .. i will use l2jfree IL pack , what to do ..

 

1) checkout the pack

2) go into L2_GameServer_IL\src\main\java\net\sf\l2j\gameserver\handler\voicedcommandhandlers

 

and make a new VoiceInfo.java file and put inside that

 

/*
* 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 net.sf.l2j.gameserver.handler.voicedcommandhandlers;

import net.sf.l2j.Config;
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.serverpackets.NpcHtmlMessage;

/**
* @author Michiru
*
*/
public class VoiceInfo implements IVoicedCommandHandler
{
private static String[]	VOICED_COMMANDS	=
										{ "info" };

/* (non-Javadoc)
* @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#useVoicedCommand(java.lang.String, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
*/
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{
	String htmFile = "data/html/custom/xx.htm";
	String htmContent = HtmCache.getInstance().getHtm(htmFile);
	if (htmContent != null)
	{
		NpcHtmlMessage infoHtml = new NpcHtmlMessage(1);
		infoHtml.setHtml(htmContent);
		activeChar.sendPacket(infoHtml);
	}
	else
	{
		activeChar.sendMessage("omg lame error! where is " + htmFile + " ! blame the Server Admin");
	}
	return true;
}

public String[] getVoicedCommandList()
{
	return VOICED_COMMANDS;
}
}

 

so you see that String htmFile = "data/html/custom/xx.htm";

 

here is the path of the htm you will see IG .. you can change it as you wish ! If you forget to put the htm file it will show up this

 

"omg lame error! where is " + htmFile + " ! blame the Server Admin"

 

Fine :D change it :P

 

so what you do it to make a .htm file named it as you want and replace the number there where is xx.htm .. now we go to

 

L2_GameServer_IL\src\main\java\net\sf\l2j\gameserver\handler\

 

we open voicecommandhandlers.java and then you have to put

 

import net.sf.l2j.gameserver.handler.voicedcommandhandlers.VoiceInfo;

 

after import net.sf.l2j.gameserver.handler.voicedcommandhandlers.CastleDoors;

or as your folder is .. if u have more it will be shown different ..

 

now u go on line 54 and after this line u put

 

        registerVoicedCommandHandler(new VoiceInfo());

 

then your new voice command is register ! Compile the pack via maven and you are ready ! Have Fun

 

Credits to me .

 

PS : DONT SPAM!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • the links are offiline, could you reupload them please, if you have other versions of h5 or c6 could you share them too, thanks!
    • Good afternoon everyone, we’ll get a couple of strong players in the CP, more details can be found here https://mw2.community/topic/211276-awr-team/  
    • so i bought this crap of the server few years back and i just found it laying around on my pc and i thought i should share it, if i remember correctly this crap has a lot of bugs that people abuse 🙂   https://drive.google.com/file/d/13QWg8pi4BPbGbTmlygZ078LjL6Fb0J2a/view?usp=sharing source   https://drive.google.com/file/d/13QWg8pi4BPbGbTmlygZ078LjL6Fb0J2a/view?usp=sharing system    
    • Error: Unable to access jarfile libs\Geodata_Converter_v01.jar
    • Since last massive leak as explained as 07/09 (notably all development branches), I don't accept anymore financial newcomers that easily. People will have to contribute 100 cookies worth of contributions (bug reports/fixes) as a first step to be accepted as Donator. Free user can join after sharing over 200 cookies out of contributions, compared to 100 cookies before. You can say thanks to RusAcis, and notably his worthless leader, UnleashedForce. The size of users will continue to shrink if more leaks occur, until true helpers only will be left. New prices are as following : Joining price: 200€ + 100 cookies, or 200 cookies This fee has to be paid if you are joining aCis project. Next month, and all other months, you will have to donate only basic monthly donation. Monthly price: 10€ / 10 cookies This fee has to be paid every month. I won't accept any new join fee before the 100 cookies contribution. Your money will be instantly sent back. Also, in the same shape of idea, actual supporters/donators have to be active to stay in sources. It doesn't have to be a particular amount, you just have to share from time to time *anything*. I don't accept anymore silent ppl. Only useful people will be kept.
  • Topics

×
×
  • Create New...