l2topzone.com
l2topzone.com
l2topzone.com
l2topzone.com
l2topzone.com
l2topzone.com
l2topzone.com

Author Topic: [Java Code] New interlude Newbie System  (Read 6378 times)

0 Members and 1 Guest are viewing this topic.

OfflineEglezakioc

  • Full Member
  • ***
  • Posts: 205
  • L2topzone Votes: 0
  • Servers reviews: 4
  • Reputation: +661/-0
    [Java Code] New interlude Newbie System
    « on: February 22, 2011, 01:48:13 PM »
    Well i decide to make a new interlude newbie system for my project and i will share it and here :)
    Code: [Select]
    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...
    Code: [Select]
    if (activeChar.isNewbie())
    {
      activeChar.sendMessage("Are you new?Press .yes if you are");

                            }
                }

    Code: [Select]
    --- 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
    Code: [Select]
    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: [Select]
    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...
    Code: [Select]
    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
    « Last Edit: March 09, 2011, 01:02:33 PM by Eglezakioc »

    l2topzone.com
    l2topzone.com
    l2topzone.com
    l2topzone.com
    l2topzone.com

    OfflineEglezakioc

    • Full Member
    • ***
    • Posts: 205
    • L2topzone Votes: 0
    • Servers reviews: 4
    • Reputation: +661/-0
      Re: [Java Code] New interlude Newbie System
      « Reply #1 on: March 09, 2011, 01:01:22 PM »
      UPDATE: I must inform you that now i test it and it work sure 100%!!!!

      OfflineSweeTs

      • Full Member
      • ***
      • Posts: 167
      • L2topzone Votes: 55
      • Servers reviews: 0
      • Reputation: +290/-0
        Re: [Java Code] New interlude Newbie System
        « Reply #2 on: March 09, 2011, 03:53:38 PM »
        And whats the point of doing this? o.O

        OfflineEglezakioc

        • Full Member
        • ***
        • Posts: 205
        • L2topzone Votes: 0
        • Servers reviews: 4
        • Reputation: +661/-0
          Re: [Java Code] New interlude Newbie System
          « Reply #3 on: March 10, 2011, 06:12:53 AM »
          And whats the point of doing this? o.O

          for my fun ok? whats your problem

          Post Merge: March 10, 2011, 06:42:06 AM
          Ill lock it !
          « Last Edit: March 10, 2011, 06:42:06 AM by Eglezakioc »

           

          Sitemap