Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/config/CustomMods/Commands.ini b/config/CustomMods/Commands.ini
- index 42330bf..7cd093e 100644
- --- a/config/CustomMods/Commands.ini
- +++ b/config/CustomMods/Commands.ini
- @@ -84,4 +84,10 @@
- #ID Raid Boss Command
- BossIds = 25325
- +#===================================================
- +# Enable Command Real Time
- +#===================================================
- +#Active Command: .time
- +EnableCommandRealTime = True
- +
- diff --git a/java/net/sf/l2j/Config.java b/java/net/sf/l2j/Config.java
- index c1b9fa7..39cb5b7 100644
- --- a/java/net/sf/l2j/Config.java
- +++ b/java/net/sf/l2j/Config.java
- @@ -239,6 +239,7 @@
- // --------------------------------------------------
- /** Olympiad */
- + public static boolean ENABLE_COMMAND_TIME;
- public static int OLY_START_TIME;
- public static int OLY_MIN;
- public static long OLY_CPERIOD;
- @@ -1488,6 +1489,7 @@
- int npcId = Integer.parseInt(val);
- LIST_RAID_BOSS_IDS3.add(npcId);
- }
- + ENABLE_COMMAND_TIME = Boolean.parseBoolean(Commands.getProperty("EnableCommandRealTime", "false"));
- COMMAND_EPIC_ISVIP = Boolean.parseBoolean(Commands.getProperty("EnableCommandEpicVIP", "True"));
- MESSAGE_VIP_EPIC = Commands.getProperty("EpicVIPMessageText", "Forbidden to Use Enchant near the bank!");
- ENABLE_COMMAND_RAID = Boolean.parseBoolean(Commands.getProperty("EnableCommandRaid", "false"));
- diff --git a/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java b/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
- index 66cf2a3..b5b8ebe 100644
- --- a/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
- +++ b/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
- @@ -29,6 +29,7 @@
- import net.sf.l2j.gameserver.handler.voicedcommandhandlers.BossEventCMD;
- import net.sf.l2j.gameserver.handler.voicedcommandhandlers.GainXpSp;
- import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Shiff_Mod;
- +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.TimeReal;
- import net.sf.l2j.gameserver.handler.voicedcommandhandlers.TvTEventCommand;
- import net.sf.l2j.gameserver.handler.voicedcommandhandlers.VoicedBanking;
- import net.sf.l2j.gameserver.handler.voicedcommandhandlers.VoicedBossSpawn;
- @@ -64,6 +65,10 @@
- registerVoicedCommandHandler(new BossEventCMD());
- registerVoicedCommandHandler(new TvTEventCommand());
- registerVoicedCommandHandler(new Shiff_Mod());
- + if(Config.ENABLE_COMMAND_TIME)
- + {
- + registerVoicedCommandHandler(new TimeReal());
- + }
- if(Config.ENABLE_COMMAND_RAID)
- {
- registerVoicedCommandHandler(new VoicedBossSpawn());
- diff --git a/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/TimeReal.java b/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/TimeReal.java
- new file mode 100644
- index 0000000..8960610
- --- /dev/null
- +++ b/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/TimeReal.java
- @@ -0,0 +1,37 @@
- +package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
- +
- +import java.text.SimpleDateFormat;
- +import java.util.Date;
- +
- +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
- +import net.sf.l2j.gameserver.model.actor.Player;
- +
- +/**
- + *
- + * @author Sarada
- + *
- + */
- +
- +public class TimeReal implements IVoicedCommandHandler
- +{
- + private static String[] _voicedCommands =
- + {
- + "time",
- + };
- +
- + @Override
- + public boolean useVoicedCommand(String command, Player activeChar, String target)
- + {
- + String RealTime = (new SimpleDateFormat("H:mm")).format(new Date());
- + activeChar.sendMessage("It's "+RealTime+" in the real world.");
- + return false;
- +
- + }
- +
- + @Override
- + public String[] getVoicedCommandList()
- + {
- + return _voicedCommands;
- + }
- +
- +}
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement