Well i decide to make a new interlude newbie system for my project and i will share it and here
What is it? when you login u receive a message "are you newbie?press .yes" when you press it you will able to see your text....
Well lets start...
if (activeChar.isNewbie())
{
activeChar.sendMessage("Are you new?Press .yes if you are");
}
}
--- java/net/sf/l2j/gameserver/GameServer.java(revision 147)
+++ java/net/sf/l2j/gameserver/GameServer.java(working copy)
@@ -209,6 +209,7 @@
import net.sf.l2j.gameserver.handler.usercommandhandlers.PartyInfo;
import net.sf.l2j.gameserver.handler.usercommandhandlers.Time;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Banking;
+import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Yes;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Wedding;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.stats;
import net.sf.l2j.gameserver.idfactory.IdFactory;
@@ -625,8 +626,10 @@
if(Config.BANKING_SYSTEM_ENABLED)
_voicedCommandHandler.registerVoicedCommandHandler(new Banking());
+
+if(Config.ONLINE_PLAYERS)
+_voicedCommandHandler.registerVoicedCommandHandler(new Yes());
-
_log.config("VoicedCommandHandler: Loaded " + _voicedCommandHandler.size() + " handlers.");
Now make
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java(revision 147)
+++ java/net/sf/l2j/Config.java(working copy)
@@ -963,6 +963,7 @@
public static boolean ALT_GAME_FLAGED_PLAYER_CAN_USE_GK;
public static boolean SHOW_WELCOME_HTML_ON_PLAYER_LOGIN;
public static int TRADE_UNITS;
+ public static boolean Yes;
/** Custom Project Modifications - End */
/** FloodProtector - Start */
@@ -2069,6 +2070,7 @@
STARTING_TITLE = L2JModSettings.getProperty("StartingTitle", "Something");
SHOW_WELCOME_HTML_ON_PLAYER_LOGIN = Boolean.parseBoolean(L2JModSettings.getProperty("ShowWelcomeHtmlOnLogin", "False"));
TRADE_UNITS = Integer.parseInt(L2JModSettings.getProperty("TradeUnits", "250"));
+ Yes = Boolean.parseBoolean(L2JModSettings.getProperty("Yes", "True"));
/** Custom Project Modifications - End */
Now make yes.java to voiced command handlers
Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Yes.java(revision 0)
+++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Yes.java(revision 0)
@@ -0,0 +1,39 @@
/*
* 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.L2World;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
/**
*
* @author Iklesos
*
* this class...
* shows the amount of online players to any1 who calls it.
*/
public class Yes implements IVoicedCommandHandler
{
private static final String[] VOICED_COMMANDS = { "yes" };
public boolean useVoicedCommand(String command, L2PcInstance player, String target)
{
if (command.equalsIgnoreCase("yes"))
{
player.sendMessage("+getName()+");
player.sendMessage("So you are new right?Welcome to our server and dont forget to vote for us!");
player.sendMessage("your text");
player.sendMessage("your text");
player.sendMessage("your text");
player.sendMessage("your text");
player.sendMessage("your text");
player.sendMessage("your text");
player.sendMessage("your text");
player.sendMessage("your text");
}return true;
}
public String[] getVoicedCommandList()
{
return VOICED_COMMANDS;
}
}
\ No newline at end of file
And now...
Index: java/config/l2jmods.properties
===================================================================
--- java/config/l2jmods.properties(revision 147)
+++ java/config/l2jmods.properties(working copy)
@@ -289,3 +289,8 @@
+# Allows user to use .yes Command
+# Default : True
+Newbie system = True
Creadits to me
P.S.: dont forget to make the file Yes not yes (with Y)
Linkback: https://l2topzone.com/forum/index.php?topic=2512.0