ChristianMacedo

Delay Enchanted Items aCis

Mar 1st, 2022 (edited)
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 KB | None | 0 0
  1. diff --git /config/server.properties
  2. index e0b6b37..4665c90 100644
  3. --- a/config/server.properties
  4. +++ b/config/server.properties
  5. @@ -256,6 +256,7 @@
  6. GlobalChatTime = 0
  7. TradeChatTime = 0
  8. SocialTime = 2000
  9. +UserItemTimeEnchant = 200
  10.  
  11. # =================================================================
  12. # Threadpool
  13. diff --git /java/net/sf/l2j/Config.java
  14. index ede73e5..df388b4 100644
  15. --- a/java/net/sf/l2j/Config.java
  16. +++ b/java/net/sf/l2j/Config.java
  17. @@ -1170,6 +1170,7 @@
  18. public static int TRADE_CHAT_TIME;
  19. public static int SOCIAL_TIME;
  20. public static int USER_ITEM_TIME;
  21. + public static int USER_ITEM_TIME_ENCHANT;
  22.  
  23.  
  24. /** Threads & Packets size */
  25. @@ -3251,6 +3252,7 @@
  26. TRADE_CHAT_TIME = server.getProperty("TradeChatTime", 0);
  27. SOCIAL_TIME = server.getProperty("SocialTime", 2000);
  28. USER_ITEM_TIME = server.getProperty("UserItemTime", 4200);
  29. + USER_ITEM_TIME_ENCHANT = server.getProperty("UserItemTimeEnchant", 4200);
  30.  
  31. //SCHEDULED_THREAD_POOL_COUNT = server.getProperty("ScheduledThreadPoolCount", -1);
  32. //THREADS_PER_SCHEDULED_THREAD_POOL = server.getProperty("ThreadsPerScheduledThreadPool", 4);
  33. diff --git /java/net/sf/l2j/gameserver/network/FloodProtectors.java
  34. index 5dcf3d5..3b612c0 100644
  35. --- a/java/net/sf/l2j/gameserver/network/FloodProtectors.java
  36. +++ b/java/net/sf/l2j/gameserver/network/FloodProtectors.java
  37. @@ -6,6 +6,7 @@
  38. {
  39. public static enum Action
  40. {
  41. + USER_ITEM_ENCHANT(Config.USER_ITEM_TIME_ENCHANT),
  42. USER_ITEM(Config.USER_ITEM_TIME),
  43. ROLL_DICE(Config.ROLL_DICE_TIME),
  44. HERO_VOICE(Config.HERO_VOICE_TIME),
  45. diff --git /java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java
  46. index fe2b3ab..8ddea4c 100644
  47. --- /java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java
  48. @@ -2,19 +2,20 @@
  49.  
  50. import net.sf.l2j.commons.random.Rnd;
  51.  
  52. +import net.sf.l2j.Config;
  53. import net.sf.l2j.gameserver.model.World;
  54. import net.sf.l2j.gameserver.model.actor.instance.Player;
  55. import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  56. +import net.sf.l2j.gameserver.network.FloodProtectors;
  57. +import net.sf.l2j.gameserver.network.FloodProtectors.Action;
  58. import net.sf.l2j.gameserver.network.SystemMessageId;
  59. import net.sf.l2j.gameserver.network.serverpackets.EnchantResult;
  60. import net.sf.l2j.gameserver.network.serverpackets.InventoryUpdate;
  61. import net.sf.l2j.gameserver.network.serverpackets.ItemList;
  62. import net.sf.l2j.gameserver.network.serverpackets.StatusUpdate;
  63. import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  64. import net.sf.l2j.gameserver.util.Broadcast;
  65.  
  66. public final class RequestEnchantItem extends L2GameClientPacket
  67. @@ -104,6 +105,11 @@
  68. {
  69. return;
  70. }
  71. + if (!FloodProtectors.performAction(activeChar.getClient(), Action.USER_ITEM_ENCHANT))
  72. + {
  73. + activeChar.sendMessage("Anti Enchant Interface Delay!");
  74. + return;
  75. + }
  76. if (activeChar.getActiveTradeList() != null)
  77. {
  78. activeChar.cancelActiveTrade();
  79.  
Add Comment
Please, Sign In to add comment