Jump to content

Recommended Posts

Posted

Ok . Everyone know how to create these commands like .command , but now i want to say how to create thats /command . I think it look much better  ;)

 


 

This guide is for L2J files , if somone want make it for other pack , should change imports .

 

Ok . As We know...in newest L2J rev , we have handlers in DataPack ( .java files ) so we dont must compile them in core to make them working .

 


 

Ok . For example we want to create command and when we use it , it will show us window with our text .

 

1 . First step :

 

You should open :

data\scripts\handlers\usercommandhandlers

 

2. Second Step :

 

Create new .java file . For example ServerInfo.java

 

3. Third Step :

 

- Ok , We have our .java file . So now We must open this file and start writing :

 

/*
* 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/>.
*/

 

We know , this is GNU license , dont forget to paste it in our file .

 


 

- Then We must import some classes needed for shown html window in game , so :

 

package handlers.usercommandhandlers;

import net.sf.l2j.gameserver.handler.IUserCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;

 


 

Ok , we have imported needed classes from core , now we must create our class :

 

public class ServerInfo implements IUserCommandHandler
{
private static final int[] COMMAND_IDS =
{
	121
};

 

Now all should ask...omg but what is that ? What its this ID ( 121 in this example ) . The answer is simple :

 

This is ID form our client . We can define this in : commandname-e.dat file . Ok , download FileEdit and open this fille , we should have somethink like that :

 

whdw91.jpg

 

- Ok , first column if for command number ( 1,2,3,4,5,5 ... )

- Secound column is for command ID - yes we need it in our class ( I'ill show it again , where we will put ID ) :

 

 

private static final int[] COMMAND_IDS =

{

121

};

 


 

Ok , we want to add that command : /serverinfo , so we must put :

 

- 122 in first column , becouse last one was 121 .. ( we are smarts - yeah  ;) )

- 121 in secound column , becouse last one was 120 ... ok this is our comman ID , we must this into our class ( look upper , to show where put this ... )

- And in third column we must add :

 

a,serverinfo\0

 

Now when we use /serverinfo in game , server will try to use command with 121 ID

 

So it look like this :

 

1248un6.jpg

 

- Close and save file , this is it  ;)

 


 

Now add to our script this :

 

/**

*

* @see net.sf.l2j.gameserver.handler.IUserCommandHandler#useUserCommand(int, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance)

*/

public boolean useUserCommand(int id, L2PcInstance activeChar)

{

if (id != COMMAND_IDS[0])

return false;

                NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(0);

                npcHtmlMessage.setHtml("<html><head><title>TvT Event</title></head><body>Your Text Here</body></html>");

                activeChar.sendPacket(npcHtmlMessage);

                return true;

        }

 

/**

*

* @see net.sf.l2j.gameserver.handler.IUserCommandHandler#getUserCommandList()

*/

public int[] getUserCommandList()

{

return COMMAND_IDS;

}

}

 


 

Done , our ServerInfo.java should look 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 handlers.usercommandhandlers;

import net.sf.l2j.gameserver.handler.IUserCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;

/**
* Support for /serverinfo command
* Added by Matim
*/
public class ServerInfo implements IUserCommandHandler
{
private static final int[] COMMAND_IDS =
{
	121
};

/**
 * 
 * @see net.sf.l2j.gameserver.handler.IUserCommandHandler#useUserCommand(int, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance)
 */
public boolean useUserCommand(int id, L2PcInstance activeChar)
{
	if (id != COMMAND_IDS[0])
		return false;
                NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(0); 
                npcHtmlMessage.setHtml("<html><head><title>TvT Event</title></head><body>Your team won the event. Look in your inventory, there should be your reward.</body></html>"); 
                activeChar.sendPacket(npcHtmlMessage); 
                return true;
        }

/**
 * 
 * @see net.sf.l2j.gameserver.handler.IUserCommandHandler#getUserCommandList()
 */
public int[] getUserCommandList()
{
	return COMMAND_IDS;
}
}

 


 

Now we must add our script to MasterHandler.java in \data\scripts\handlers folder

 

- Open this file : And find these lines , in first column :

 

import handlers.usercommandhandlers.ChannelDelete;
import handlers.usercommandhandlers.ChannelLeave;
import handlers.usercommandhandlers.ChannelListUpdate;
import handlers.usercommandhandlers.ClanPenalty;
import handlers.usercommandhandlers.ClanWarsList;
import handlers.usercommandhandlers.DisMount;
import handlers.usercommandhandlers.Escape;
import handlers.usercommandhandlers.InstanceZone;
import handlers.usercommandhandlers.Loc;
import handlers.usercommandhandlers.Mount;
import handlers.usercommandhandlers.OlympiadStat;
import handlers.usercommandhandlers.PartyInfo;
import handlers.usercommandhandlers.Time;

 

and add our :

 

import handlers.usercommandhandlers.ServerInfo;

 


 

Now find this column :

 

	private static void loadUserHandlers()
{
	UserCommandHandler.getInstance().registerUserCommandHandler(new ClanPenalty());
	UserCommandHandler.getInstance().registerUserCommandHandler(new ClanWarsList());
	UserCommandHandler.getInstance().registerUserCommandHandler(new DisMount());
	UserCommandHandler.getInstance().registerUserCommandHandler(new Escape());
	UserCommandHandler.getInstance().registerUserCommandHandler(new InstanceZone());
	UserCommandHandler.getInstance().registerUserCommandHandler(new Loc());
	UserCommandHandler.getInstance().registerUserCommandHandler(new Mount());
	UserCommandHandler.getInstance().registerUserCommandHandler(new PartyInfo());
	UserCommandHandler.getInstance().registerUserCommandHandler(new Time());
	UserCommandHandler.getInstance().registerUserCommandHandler(new OlympiadStat());
	UserCommandHandler.getInstance().registerUserCommandHandler(new ChannelLeave());
	UserCommandHandler.getInstance().registerUserCommandHandler(new ChannelDelete());
	UserCommandHandler.getInstance().registerUserCommandHandler(new ChannelListUpdate());
	UserCommandHandler.getInstance().registerUserCommandHandler(new ServerInfo());
	_log.config("Loaded " + UserCommandHandler.getInstance().size() + " UserHandlers");
}

 

And add this :

 

UserCommandHandler.getInstance().registerUserCommandHandler(new ServerInfo());

 

(under : UserCommandHandler.getInstance().registerUserCommandHandler(new ChannelListUpdate()); )

 


 

Save , and restart Your server , done now type /serverinfo in game  ;)

 

Credits goes to me

Posted

Very nice guide, for niewbie...

 

Keep it up!

 

p.s: This have client modding so... illegal ... .info or .infoserver etc is much better no need client modding ;)

Posted

OMG Great share I was looking for a guide like this , cause I only know how to edit commands from Banking.java but couldn't find a way to crate a seperate *.java file.

Thanks again.

Posted

you made us laugh so much

it's hard to find good server's without cilent modding

 

Us? how many ppl are you? are like all in one?

 

1 Waring stay on topic!

 

As i said is very good guide for starter .... but is client moding so... illegal... If you don't agree go expres your opinion at www.NcSoft.com.

Posted

Man ...i fully agree with that what are you talking about , but as i said ..this is for thats people who need and want use it..same like custom items.

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • Forever Lineage Interlude mid-rate built for people with one hour a night Chronicle: Interlude XP/SP: 25x  |  Drop: 10x  |  Adena: 12x  |  Spoil: 15x Enchant: Safe +3  |  Max +21 Fresh start: 11 September 2026 - server is live now Website: https://l2forever.eu Discord: https://discord.gg/96rdukHvbs Why this server exists I have wanted my own Lineage 2 server since I was a teenager. I tried, failed, came back, failed again. Fifteen years later I am a developer with a full-time job, a family, and maybe an hour before bed. Every server I tried as an adult made that hour feel wasted - log in, kill a few mobs, no real progress, log out annoyed. So I built the server I actually wanted to play. Everything below is designed around one question: can you log in, make real progress, and log out on your own terms in one session? What is different Rebirth and Talent Tree - hit level 80, reset to level 1, keep your gear and skill enchants, earn talent points. Build a different character every rebirth. Bounty Hunter - daily hunt tasks with rank progression, Bounty Coins, and rare bounties. One bounty fits one session. Companions - a summonable tank, healer, or damage ally for any class. First one costs three bounties. Solo play without a solo class. Auto-farm - your character farms on its own for 2 hours a day at full XP and half loot. Solo, monsters only. The only automation allowed. Alchemy - brew stronger HP/MP potions from monster drops, no recipe needed. Custom Gludin start zone - buffs, passive mobs, and the NPCs you need, through your first 20 levels. Shorter class quests - 1st, 2nd, 3rd class, Subclass and Noblesse, all through one NPC. Champions - 5% spawn above level 40, 3x HP, 8x XP, 4-5x loot. Worth stopping for. Scheme buffer, shop up to C-grade, teleporter - B-grade and above come from crafting, drops, and quests. Seasons - each season brings Talent Tree changes. Your master account, titles, and cosmetics carry over. The rules I hold myself to Solo is the default, not a punishment. No clan required, no raid schedule, no guilt when you log off. Paid tiers add convenience and time, not power - the free baseline is the full game. No surprise wipes: if another fresh start ever happens, it is announced at least a month ahead. One developer, no shady admin, and I play on it myself. This is the server I needed fifteen years ago. Come see what I made. https://l2forever.eu
    • 🚀 September Restock Live! Upgrade your personal Gmail to 5TB + Gemini Pro 12-18 Months instantly. 100% private and automated delivery!
    • [WTB / HIRING] High-End Gracia Final Source Code & Custom Pack Bundle [Serious Budget / Paid] Hello MaxCheaters Community, We are launching a new international High-End PvP project and are actively looking to acquire a complete, stable Gracia Final Source Code package OR hire an experienced L2J developer/team for custom module integration. We are looking for a solid foundation with the following specifications: 1. Full Java Source Code (.java) - Absolutely required. We need full access to edit core mechanics, custom items, weapons, and balance. No compiled-only .jar files. 2. Premium Geodata & Pathfinding - 100% complete and fixed Geodata for Gracia Final (no wall-shooting, no falling through map). 3. Modern QoL & Systems - Fully working Auto-Farm engine with clean client UI. - VIP/Premium subscription system (non-P2W rates/features). 4. Custom Content & Balance Ready - Ability to easily inject custom armor sets, weapons with custom glows/auras, and PvP zones. 5. Anti-Bot / Security Integration - Core ready to pair with top protection solutions (Active Anticheat, SmartGuard, or equivalent). 6. Client Tools & System Patch Support - Patch files and editing tools for itemname-e.dat, armorgrp.dat, weapongrp.dat, and custom interfaces. -------------------------------------------------- FORMAT OF COOPERATION: - We can purchase a ready, bug-free Source Code package. - We are also open to hiring a dedicated developer for custom task-based modules. - Fast payment via Crypto / PayPal / Bank Transfer. If you have a working build or offer dev services, PM me here or drop your Telegram/Discord contact below. Thanks!
    • WARFRONT is an Interlude faction PvP server built around one idea: the battlefield should never feel static. Choose your side. Angels vs Demons.   Capture Outposts to move the frontline and your faction's respawns. Fight for the Main Outpost to unlock dynamic events and HQ assaults. Push into enemy territory and destroy their Headquarters to win the battle. But WARFRONT goes far beyond traditional faction PvP.     ▶️ Dynamic Outpost & territory warfare ▶️ Daily Faction Castle Siege ▶️ Weekly Clan Siege ▶️ Grand Boss events ▶️ Kamaloka instanced party content ▶️ Reworked Interlude classes ▶️ Skill & Ability Tree  ▶️ Battlefield Contracts ▶️ Faction & individual rankings ▶️ Long-term character progression ▶️  Battle Pass & cosmetic progression ▶️  30-minute rotating battlefields   We've also reworked classes that are traditionally overlooked in faction PvP. Bishop can enter an offensive Inquisitor role, Daggers have Shadow Step, Prophet has its own combat toolkit, Overlord supports the entire faction, and several other classes have received new mechanics and balance changes. ▶️  SKILL & ABILITY TREE  Skill & Ability Tree system designed to add another layer of character progression and build choice to WARFRONT. Rather than simply increasing stats, the goal is to give players meaningful choices that can change how their character develops and how their class performs on the battlefield. This system is currently being tested, with more information and previews coming soon. The goal isn't to replace Interlude. It's to make Interlude faction PvP exciting again.   ▶️ CLOSED BETA: 03 OCTOBER 2026 Closed Beta will be our opportunity to push the systems, class balance and battlefield mechanics as hard as possible before Grand Opening. We built it. Now we need you to break it. ▶️  Website & Closed Beta Registration https://l2warfront.com ▶️  Discord https://discord.gg/u93YhB5Exy
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..