Advertisement
Guest User

Announce Record for aCis

a guest
Mar 22nd, 2020
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
  2. index 58fb660..07a50ad 100644
  3. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
  4. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
  5. @@ -8,6 +8,8 @@
  6. import java.util.Date;
  7. import java.util.Map.Entry;
  8.  
  9. +import net.sf.l2j.commons.concurrent.ThreadPool;
  10. +
  11. import net.sf.l2j.Config;
  12. import net.sf.l2j.L2DatabaseFactory;
  13. import net.sf.l2j.gameserver.communitybbs.Manager.MailBBSManager;
  14. @@ -466,12 +465,28 @@
  15.  
  16. if (player.getActiveClass() == player.getBaseClass() && player.isHero() && !Config.ANNOUNCE_HERO_ENTER_BY_CLAN_MEMBER_MSG.isEmpty())
  17. World.announceToOnlinePlayers(player.getClan() != null ? Config.ANNOUNCE_HERO_ENTER_BY_CLAN_MEMBER_MSG.replace("%player%", player.getName()).replace("%clan%", player.getClan().getName()).replace("%classe%", player.setClassName(player.getBaseClass())) : Config.ANNOUNCE_HERO_ENTER_BY_PLAYER_MSG.replace("%player%", player.getName()).replace("%classe%", player.setClassName(player.getBaseClass())), true);
  18.  
  19. ClassMaster.showQuestionMark(player);
  20.  
  21. + if (Config.ANNOUNCE_ONLINE_PLAYERS_DELAY > 0)
  22. + ThreadPool.schedule(() -> announceRecord(player), Config.ANNOUNCE_ONLINE_PLAYERS_DELAY * 1000 * 60);
  23. +
  24. player.sendPacket(ActionFailed.STATIC_PACKET);
  25. }
  26.  
  27. + public void announceRecord(Player player)
  28. + {
  29. + int NumberofPlayers = World.getInstance().getPlayers().size();
  30. +
  31. + if (NumberofPlayers == 1)
  32. + player.sendMessage("Record " + NumberofPlayers + " player is online.");
  33. + else
  34. + player.sendMessage("Record " + NumberofPlayers + " player are online.");
  35. + }
  36. +
  37. @Override
  38. protected boolean triggersOnActionRequest()
  39. {
  40. diff --git a/aCis_gameserver/java/net/sf/l2j/Config.java b/aCis_gameserver/java/net/sf/l2j/Config.java
  41. index 30a8fe8..a2ab434 100644
  42. --- a/aCis_gameserver/java/net/sf/l2j/Config.java
  43. +++ b/aCis_gameserver/java/net/sf/l2j/Config.java
  44. @@ -407,6 +443,7 @@
  45. public static boolean DEEPBLUE_DROP_RULES;
  46. public static boolean ALT_GAME_DELEVEL;
  47. public static int DEATH_PENALTY_CHANCE;
  48. + public static int ANNOUNCE_ONLINE_PLAYERS_DELAY;
  49. public static int CANCEL_SECONDS;
  50. public static int RAIDBOSS_NOBLES;
  51. public static boolean ENABLE_SPREEKILLS;
  52. @@ -1167,6 +1261,7 @@
  53. DEEPBLUE_DROP_RULES = players.getProperty("UseDeepBlueDropRules", true);
  54. ALT_GAME_DELEVEL = players.getProperty("Delevel", true);
  55. DEATH_PENALTY_CHANCE = players.getProperty("DeathPenaltyChance", 20);
  56. + ANNOUNCE_ONLINE_PLAYERS_DELAY = players.getProperty("AnnounceOnlinePlayersDelay", 60);
  57. CANCEL_SECONDS = players.getProperty("CancelSeconds", 5);
  58. RAIDBOSS_NOBLES = players.getProperty("RaidBossId", 0);
  59. ENABLE_SPREEKILLS = players.getProperty("EnableSpreeKills", false);
  60. diff --git a/aCis_gameserver/config/players.properties b/aCis_gameserver/config/players.properties
  61. index 2df0cd8..2e7d2ed 100644
  62. --- a/aCis_gameserver/config/players.properties
  63. +++ b/aCis_gameserver/config/players.properties
  64. @@ -42,6 +42,10 @@
  65. # Death Penalty chance if killed by mob (in %), 20 by default
  66. DeathPenaltyChance = 20
  67.  
  68. +#Announcer all player online
  69. +# Default : 5 minutes
  70. +AnnounceOnlinePlayersDelay = 5
  71. +
  72. # This setting back the buffs after the set time in Cancel in Seconds
  73. CancelSeconds = 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement