Advertisement
Sarada-L2

Command .time Yo: Sarada Acis 398

May 24th, 2021
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. diff --git a/config/CustomMods/Commands.ini b/config/CustomMods/Commands.ini
  2. index 42330bf..7cd093e 100644
  3. --- a/config/CustomMods/Commands.ini
  4. +++ b/config/CustomMods/Commands.ini
  5. @@ -84,4 +84,10 @@
  6. #ID Raid Boss Command
  7. BossIds = 25325
  8.  
  9. +#===================================================
  10. +# Enable Command Real Time
  11. +#===================================================
  12. +#Active Command: .time
  13. +EnableCommandRealTime = True
  14. +
  15.  
  16. diff --git a/java/net/sf/l2j/Config.java b/java/net/sf/l2j/Config.java
  17. index c1b9fa7..39cb5b7 100644
  18. --- a/java/net/sf/l2j/Config.java
  19. +++ b/java/net/sf/l2j/Config.java
  20. @@ -239,6 +239,7 @@
  21. // --------------------------------------------------
  22.  
  23. /** Olympiad */
  24. + public static boolean ENABLE_COMMAND_TIME;
  25. public static int OLY_START_TIME;
  26. public static int OLY_MIN;
  27. public static long OLY_CPERIOD;
  28. @@ -1488,6 +1489,7 @@
  29. int npcId = Integer.parseInt(val);
  30. LIST_RAID_BOSS_IDS3.add(npcId);
  31. }
  32. + ENABLE_COMMAND_TIME = Boolean.parseBoolean(Commands.getProperty("EnableCommandRealTime", "false"));
  33. COMMAND_EPIC_ISVIP = Boolean.parseBoolean(Commands.getProperty("EnableCommandEpicVIP", "True"));
  34. MESSAGE_VIP_EPIC = Commands.getProperty("EpicVIPMessageText", "Forbidden to Use Enchant near the bank!");
  35. ENABLE_COMMAND_RAID = Boolean.parseBoolean(Commands.getProperty("EnableCommandRaid", "false"));
  36. diff --git a/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java b/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
  37. index 66cf2a3..b5b8ebe 100644
  38. --- a/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
  39. +++ b/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
  40. @@ -29,6 +29,7 @@
  41. import net.sf.l2j.gameserver.handler.voicedcommandhandlers.BossEventCMD;
  42. import net.sf.l2j.gameserver.handler.voicedcommandhandlers.GainXpSp;
  43. import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Shiff_Mod;
  44. +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.TimeReal;
  45. import net.sf.l2j.gameserver.handler.voicedcommandhandlers.TvTEventCommand;
  46. import net.sf.l2j.gameserver.handler.voicedcommandhandlers.VoicedBanking;
  47. import net.sf.l2j.gameserver.handler.voicedcommandhandlers.VoicedBossSpawn;
  48. @@ -64,6 +65,10 @@
  49. registerVoicedCommandHandler(new BossEventCMD());
  50. registerVoicedCommandHandler(new TvTEventCommand());
  51. registerVoicedCommandHandler(new Shiff_Mod());
  52. + if(Config.ENABLE_COMMAND_TIME)
  53. + {
  54. + registerVoicedCommandHandler(new TimeReal());
  55. + }
  56. if(Config.ENABLE_COMMAND_RAID)
  57. {
  58. registerVoicedCommandHandler(new VoicedBossSpawn());
  59. diff --git a/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/TimeReal.java b/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/TimeReal.java
  60. new file mode 100644
  61. index 0000000..8960610
  62. --- /dev/null
  63. +++ b/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/TimeReal.java
  64. @@ -0,0 +1,37 @@
  65. +package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
  66. +
  67. +import java.text.SimpleDateFormat;
  68. +import java.util.Date;
  69. +
  70. +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
  71. +import net.sf.l2j.gameserver.model.actor.Player;
  72. +
  73. +/**
  74. + *
  75. + * @author Sarada
  76. + *
  77. + */
  78. +
  79. +public class TimeReal implements IVoicedCommandHandler
  80. +{
  81. + private static String[] _voicedCommands =
  82. + {
  83. + "time",
  84. + };
  85. +
  86. + @Override
  87. + public boolean useVoicedCommand(String command, Player activeChar, String target)
  88. + {
  89. + String RealTime = (new SimpleDateFormat("H:mm")).format(new Date());
  90. + activeChar.sendMessage("It's "+RealTime+" in the real world.");
  91. + return false;
  92. +
  93. + }
  94. +
  95. + @Override
  96. + public String[] getVoicedCommandList()
  97. + {
  98. + return _voicedCommands;
  99. + }
  100. +
  101. +}
  102. \ No newline at end of file
  103.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement