Реклама - основной доход Cscontrol.Ru. Пожалуйста, внесите наш сайт в список исключений, чтобы мы могли развивать наш проект и радовать Вас новыми материалами.
  • Страница 1 из 1
  • 1
Custom система Newbie персонажа
Дата: Пятница, 22.04.2011, 21:08 | Сообщение # 1
Модераторы Сообщения: 56 Награды: 0
Суть состоит в том, что игроку теперь можно самому выбирать: становится ли он Newbie или нет.
При входе игроку задается вопрос: Newbie ли он? И при положительном ответе ваш статус изменяется на Newbie.

Code
Enterworld.java

if (activeChar.isNewbie())
{
activeChar.sendMessage("Are you new?Press .yes if you are");

}
}

Code

--- 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.Yes)
+ _voicedCommandHandler.registerVoicedCommandHandler(new Yes());

-
_log.config("VoicedCommandHandler: Loaded " + _voicedCommandHandler.size() + " handlers.");

Now Make

Code
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

Code:

Code
Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Yes.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.


Аренда сервера!
CS-DATA.ORG.UA

1) Качество
2) Низкий пинг
3) Низкие цены

Дата: Пятница, 22.04.2011, 21:08 | Сообщение # 2
Модераторы Сообщения: 56 Награды: 0
Code
*
* 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 Nice
*
* 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...

Code:

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


Аренда сервера!
CS-DATA.ORG.UA

1) Качество
2) Низкий пинг
3) Низкие цены

  • Страница 1 из 1
  • 1
Поиск:

Администрация не несёт ответственности за содержащие файлы на данном портале.
Все материалы на сайте принадлежат исключительно их владельцам!
Главный администратор сайта TheNega | | Sitemap | Sitemap-Forum | RSS лента
Всё для Counter-Strike 1.6, GO
Всё для CS:GO