tobaJK

L2j <-> Discord

Sep 25th, 2021 (edited)
359
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/aCis_gameserver/java/net/sf/l2j/discord/Discord.java b/aCis_gameserver/java/net/sf/l2j/discord/Discord.java
  2. new file mode 100644
  3. index 0000000..8cf3f83
  4. --- /dev/null
  5. +++ b/aCis_gameserver/java/net/sf/l2j/discord/Discord.java
  6. @@ -0,0 +1,70 @@
  7. +package net.sf.l2j.discord;
  8. +
  9. +import java.util.Arrays;
  10. +import java.util.List;
  11. +import java.util.Set;
  12. +import java.util.concurrent.ConcurrentHashMap;
  13. +
  14. +import javax.security.auth.login.LoginException;
  15. +
  16. +import net.dv8tion.jda.api.JDA;
  17. +import net.dv8tion.jda.api.JDABuilder;
  18. +import net.dv8tion.jda.api.OnlineStatus;
  19. +import net.dv8tion.jda.api.entities.Activity;
  20. +import net.dv8tion.jda.api.entities.TextChannel;
  21. +import net.dv8tion.jda.api.entities.User;
  22. +import net.dv8tion.jda.api.requests.RestAction;
  23. +import net.sf.l2j.discord.actions.handlers.IDiscordHandler;
  24. +import net.sf.l2j.discord.misc.DiscordHandlers;
  25. +
  26. +/**
  27. + * @author Melron
  28. + */
  29. +public class Discord
  30. +{
  31. +   private static final String BOT_TOKEN = ""; // Your bot token here
  32. +   private static final Set<IDiscordHandler> HANDLERS = ConcurrentHashMap.newKeySet();
  33. +   private static JDA _api;
  34. +  
  35. +   public static void init()
  36. +   {
  37. +       try
  38. +       {
  39. +           initApi();
  40. +           Arrays.asList(DiscordHandlers.get()).forEach(HANDLERS::add);
  41. +       }
  42. +       catch (Exception e)
  43. +       {
  44. +           e.printStackTrace();
  45. +       }
  46. +   }
  47. +  
  48. +   private static void initApi() throws LoginException, InterruptedException
  49. +   {
  50. +       _api = JDABuilder.createDefault(BOT_TOKEN).build();
  51. +       _api.awaitReady();
  52. +       _api.getPresence().setStatus(OnlineStatus.IDLE);
  53. +       _api.getPresence().setActivity(Activity.playing("L][Melron"));
  54. +   }
  55. +  
  56. +   public static <T> void notify(Class<T> handlerClass, Object... params)
  57. +   {
  58. +       getAssignedHandlers(handlerClass).forEach(handler -> handler.notify(params));
  59. +   }
  60. +  
  61. +   private static <T> List<IDiscordHandler> getAssignedHandlers(Class<T> handlerClass)
  62. +   {
  63. +       return HANDLERS.stream().filter(handler -> handlerClass.isAssignableFrom(handler.getClass())).toList();
  64. +   }
  65. +  
  66. +   public static TextChannel getChannel(String channelName)
  67. +   {
  68. +       return _api.getTextChannelsByName(channelName, true).get(0);
  69. +   }
  70. +  
  71. +   public static RestAction<User> getUser(long id)
  72. +   {
  73. +       return _api.retrieveUserById(id);
  74. +   }
  75. +}
  76.  
  77. diff --git a/aCis_gameserver/java/net/sf/l2j/discord/actions/handlers/ChannelMessage.java b/aCis_gameserver/java/net/sf/l2j/discord/actions/handlers/ChannelMessage.java
  78. new file mode 100644
  79. index 0000000..4670955
  80. --- /dev/null
  81. +++ b/aCis_gameserver/java/net/sf/l2j/discord/actions/handlers/ChannelMessage.java
  82. @@ -0,0 +1,47 @@
  83. +package net.sf.l2j.discord.actions.handlers;
  84. +
  85. +import java.util.Arrays;
  86. +import java.util.List;
  87. +
  88. +import net.dv8tion.jda.api.entities.MessageEmbed;
  89. +import net.dv8tion.jda.api.entities.TextChannel;
  90. +import net.sf.l2j.gameserver.enums.SayType;
  91. +import net.sf.l2j.gameserver.model.actor.Player;
  92. +
  93. +/**
  94. + * @author Melron
  95. + */
  96. +public class ChannelMessage implements IDiscordHandler
  97. +{
  98. +   private static final List<String> prefixes = Arrays.asList("wtb", "wtt", "wts", "wtc");
  99. +  
  100. +   @Override
  101. +   public void notify(Object... params)
  102. +   {
  103. +       if (params[0] instanceof MessageEmbed)
  104. +       {
  105. +           sendEmbedMessage(params);
  106. +           return;
  107. +       }
  108. +      
  109. +       final SayType type = (SayType) params[0];
  110. +       final Player player = (Player) params[1];
  111. +       final String message = (String) params[2];
  112. +       final boolean isDiscordLegend = player.isDiscordLegend();
  113. +      
  114. +       if (prefixes.stream().anyMatch(message.toLowerCase()::startsWith))
  115. +           sendMessage(type, String.format("[%s]: %s %s", player.getName(), isDiscordLegend ? "@everyone " : "", message));
  116. +   }
  117. +  
  118. +   private static void sendEmbedMessage(Object... params)
  119. +   {
  120. +       final MessageEmbed message = (MessageEmbed) params[0];
  121. +       final TextChannel channel = (TextChannel) params[1];
  122. +       channel.sendMessageEmbeds(message).queue();
  123. +   }
  124. +  
  125. +   private void sendMessage(SayType channel, String message)
  126. +   {
  127. +       getChannel(channel.name().toLowerCase()).sendMessage(message).queue();
  128. +   }
  129. +}
  130. \ No newline at end of file
  131. diff --git a/aCis_gameserver/java/net/sf/l2j/discord/actions/handlers/GrandBossDeath.java b/aCis_gameserver/java/net/sf/l2j/discord/actions/handlers/GrandBossDeath.java
  132. new file mode 100644
  133. index 0000000..9a6c3c5
  134. --- /dev/null
  135. +++ b/aCis_gameserver/java/net/sf/l2j/discord/actions/handlers/GrandBossDeath.java
  136. @@ -0,0 +1,92 @@
  137. +package net.sf.l2j.discord.actions.handlers;
  138. +
  139. +import java.util.Arrays;
  140. +import java.util.concurrent.TimeUnit;
  141. +
  142. +import net.sf.l2j.commons.data.StatSet;
  143. +
  144. +import net.dv8tion.jda.api.EmbedBuilder;
  145. +import net.dv8tion.jda.api.entities.MessageEmbed;
  146. +import net.sf.l2j.gameserver.data.manager.GrandBossManager;
  147. +import net.sf.l2j.gameserver.model.actor.Player;
  148. +import net.sf.l2j.gameserver.model.actor.instance.Monster;
  149. +
  150. +/**
  151. + * @author Melron
  152. + */
  153. +public class GrandBossDeath implements IDiscordHandler
  154. +{
  155. +   @Override
  156. +   public void notify(Object... params)
  157. +   {
  158. +       final Player killer = (Player) params[0];
  159. +       final Monster boss = (Monster) params[1];
  160. +       final ImageContent image = ImageContent.get(boss.getNpcId());
  161. +       final MessageEmbed message = createBuilder(killer, boss, image);
  162. +       sendMessage(message, getChannel("raid-died"));
  163. +   }
  164. +  
  165. +   private static MessageEmbed createBuilder(Player killer, Monster monster, ImageContent image)
  166. +   {
  167. +       final EmbedBuilder builder = new EmbedBuilder();
  168. +       final StatSet info = GrandBossManager.getInstance().getStatSet(monster.getNpcId());
  169. +       builder.setColor(0x99ccff);
  170. +       builder.setAuthor("Lineage][Melron", image.getPng()[0], image.getPng()[0]);
  171. +       builder.setTitle(String.format(":skull:    *%s* has died!    :skull:\n\n:mechanical_arm:    Level ***%s***", monster.getName(), monster.getTemplate().getLevel()), "");
  172. +       builder.addField(":clock7:    Respawn Time    :clock3:", getIntervalTime(info.getLong("respawn_time") - System.currentTimeMillis()), false);
  173. +       builder.setImage(image.getPng()[1]);
  174. +       builder.setThumbnail(image.getGif());
  175. +       builder.setFooter(String.format("Last Hit: %s\nClan: %s", killer.getName(), killer.getClan() != null ? killer.getClan().getName() : "N/A"));
  176. +       return builder.build();
  177. +   }
  178. +  
  179. +   public static String getIntervalTime(long longInterval)
  180. +   {
  181. +       long intMillis = longInterval;
  182. +       final long dd = TimeUnit.MILLISECONDS.toDays(intMillis);
  183. +       intMillis -= TimeUnit.DAYS.toMillis(dd);
  184. +       final long hh = TimeUnit.MILLISECONDS.toHours(intMillis);
  185. +       intMillis -= TimeUnit.HOURS.toMillis(hh);
  186. +       final long mm = TimeUnit.MILLISECONDS.toMinutes(intMillis);
  187. +       intMillis -= TimeUnit.MINUTES.toMillis(mm);
  188. +       final long ss = TimeUnit.MILLISECONDS.toSeconds(intMillis);
  189. +       intMillis -= TimeUnit.SECONDS.toMillis(ss);
  190. +      
  191. +       final String stringInterval = "Days:%d, Hours:%d, Minutes:%d, Seconds:%d";
  192. +       return String.format("```re\n" + stringInterval + "```", dd, hh, mm, ss);
  193. +   }
  194. +  
  195. +   enum ImageContent
  196. +   {
  197. +       dummy(0, "https://j.gifs.com/y5PglQ.gif", "https://i.ibb.co/pQzBsVQ/1.png", "https://i.ibb.co/jLt1Q7w/Mob-29020.jpg"),
  198. +       Baium(29020, "https://j.gifs.com/y5PglQ.gif", "https://i.ibb.co/pQzBsVQ/1.png", "https://i.ibb.co/jLt1Q7w/Mob-29020.jpg");
  199. +      
  200. +       private final String[] _png;
  201. +       private final String _gif;
  202. +       private final int _id;
  203. +      
  204. +       ImageContent(int id_, String gif_, String... png_)
  205. +       {
  206. +           _id = id_;
  207. +           _png = png_;
  208. +           _gif = gif_;
  209. +       }
  210. +      
  211. +       public String[] getPng()
  212. +       {
  213. +           return _png;
  214. +       }
  215. +      
  216. +       public String getGif()
  217. +       {
  218. +           return _gif;
  219. +       }
  220. +      
  221. +       public static ImageContent get(int npcId)
  222. +       {
  223. +           return Arrays.stream(VALUES).filter(i -> i._id == npcId).findFirst().orElse(dummy);
  224. +       }
  225. +      
  226. +       public static final ImageContent[] VALUES = values();
  227. +   }
  228. +}
  229. diff --git a/aCis_gameserver/java/net/sf/l2j/discord/actions/handlers/IDiscordHandler.java b/aCis_gameserver/java/net/sf/l2j/discord/actions/handlers/IDiscordHandler.java
  230. new file mode 100644
  231. index 0000000..6976b19
  232. --- /dev/null
  233. +++ b/aCis_gameserver/java/net/sf/l2j/discord/actions/handlers/IDiscordHandler.java
  234. @@ -0,0 +1,35 @@
  235. +package net.sf.l2j.discord.actions.handlers;
  236. +
  237. +import net.dv8tion.jda.api.entities.MessageEmbed;
  238. +import net.dv8tion.jda.api.entities.TextChannel;
  239. +import net.dv8tion.jda.api.entities.User;
  240. +import net.dv8tion.jda.api.requests.RestAction;
  241. +import net.sf.l2j.discord.Discord;
  242. +
  243. +/**
  244. + * @author Melron
  245. + */
  246. +public interface IDiscordHandler
  247. +{
  248. +   public abstract void notify(Object... params);
  249. +  
  250. +   default void sendMessage(String message, long userId)
  251. +   {
  252. +       Discord.notify(PrivateMessage.class, userId, message);
  253. +   }
  254. +  
  255. +   default void sendMessage(MessageEmbed message, TextChannel channel)
  256. +   {
  257. +       Discord.notify(ChannelMessage.class, message, channel);
  258. +   }
  259. +  
  260. +   default TextChannel getChannel(String channelName)
  261. +   {
  262. +       return Discord.getChannel(channelName);
  263. +   }
  264. +  
  265. +   default RestAction<User> getUser(long id)
  266. +   {
  267. +       return Discord.getUser(id);
  268. +   }
  269. +}
  270. diff --git a/aCis_gameserver/java/net/sf/l2j/discord/actions/handlers/Login.java b/aCis_gameserver/java/net/sf/l2j/discord/actions/handlers/Login.java
  271. new file mode 100644
  272. index 0000000..d667d6e
  273. --- /dev/null
  274. +++ b/aCis_gameserver/java/net/sf/l2j/discord/actions/handlers/Login.java
  275. @@ -0,0 +1,34 @@
  276. +package net.sf.l2j.discord.actions.handlers;
  277. +
  278. +import java.util.stream.Collectors;
  279. +
  280. +import net.sf.l2j.gameserver.model.World;
  281. +import net.sf.l2j.gameserver.model.actor.Player;
  282. +
  283. +/**
  284. + * @author Melron
  285. + */
  286. +public class Login implements IDiscordHandler
  287. +{
  288. +   private static final String message = "Login activity!```ini\n[IP: %s]\n[Character: %s]\n[Players with same IP: %s]```";
  289. +  
  290. +   @Override
  291. +   public void notify(Object... params)
  292. +   {
  293. +       final Player player = (Player) params[0];
  294. +       final String ip = player.getIp();
  295. +       final String sameIpPlayers = World.getInstance()
  296. +                                       .getPlayers()
  297. +                                       .stream()
  298. +                                       .filter(p -> p.getIp().equals(ip))
  299. +                                       .map(Player::getName)
  300. +                                       .collect(Collectors.joining(","));
  301. +      
  302. +       sendMessage(createMessage(player.getName(), ip, sameIpPlayers), player.getDiscordID());
  303. +   }
  304. +  
  305. +   private static String createMessage(String playerName, String ip, String sameIpPlayers)
  306. +   {
  307. +       return String.format(message, ip, playerName, sameIpPlayers);
  308. +   }
  309. +}
  310. \ No newline at end of file
  311. diff --git a/aCis_gameserver/java/net/sf/l2j/discord/actions/handlers/PrivateMessage.java b/aCis_gameserver/java/net/sf/l2j/discord/actions/handlers/PrivateMessage.java
  312. new file mode 100644
  313. index 0000000..e1bc0ec
  314. --- /dev/null
  315. +++ b/aCis_gameserver/java/net/sf/l2j/discord/actions/handlers/PrivateMessage.java
  316. @@ -0,0 +1,27 @@
  317. +package net.sf.l2j.discord.actions.handlers;
  318. +
  319. +import net.dv8tion.jda.api.entities.User;
  320. +import net.dv8tion.jda.api.requests.RestAction;
  321. +
  322. +/**
  323. + * @author Melron
  324. + */
  325. +public class PrivateMessage implements IDiscordHandler
  326. +{
  327. +   @Override
  328. +   public void notify(Object... params)
  329. +   {
  330. +       final long discordMemberId = (long) params[0];
  331. +       final String message = (String) params[1];
  332. +       sendPrivateMessage(discordMemberId, message);
  333. +   }
  334. +  
  335. +   private void sendPrivateMessage(long id, String message)
  336. +   {
  337. +       final RestAction<User> user = getUser(id);
  338. +       if (user == null)
  339. +           return;
  340. +      
  341. +       user.queue(discordMember -> discordMember.openPrivateChannel().queue((channel) -> channel.sendMessage(message).queue()));
  342. +   }
  343. +}
  344. diff --git a/aCis_gameserver/java/net/sf/l2j/discord/misc/DiscordHandlers.java b/aCis_gameserver/java/net/sf/l2j/discord/misc/DiscordHandlers.java
  345. new file mode 100644
  346. index 0000000..53ad8d7
  347. --- /dev/null
  348. +++ b/aCis_gameserver/java/net/sf/l2j/discord/misc/DiscordHandlers.java
  349. @@ -0,0 +1,23 @@
  350. +package net.sf.l2j.discord.misc;
  351. +
  352. +import net.sf.l2j.discord.actions.handlers.*;
  353. +
  354. +/**
  355. + * @author Melron
  356. + */
  357. +public class DiscordHandlers
  358. +{
  359. +   private static final IDiscordHandler[] listeners = new IDiscordHandler[]
  360. +   {
  361. +       new Login(),
  362. +       new ChannelMessage(),
  363. +       new PrivateMessage(),
  364. +       new GrandBossDeath(),
  365. +   };
  366. +  
  367. +   public static IDiscordHandler[] get()
  368. +   {
  369. +       return listeners;
  370. +   }
  371. +}
  372.  
  373. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/GameServer.java b/aCis_gameserver/java/net/sf/l2j/gameserver/GameServer.java
  374. index e682cc6..2929c44 100644
  375. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/GameServer.java
  376. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/GameServer.java
  377. @@ -15,7 +15,9 @@
  378.  import net.sf.l2j.commons.util.SysUtil;
  379.  
  380.  import net.sf.l2j.Config;
  381. +import net.sf.l2j.discord.Discord;
  382.  import net.sf.l2j.gameserver.communitybbs.CommunityBoard;
  383.  import net.sf.l2j.gameserver.data.SkillTable;
  384.  import net.sf.l2j.gameserver.data.cache.CrestCache;
  385.  import net.sf.l2j.gameserver.data.cache.HtmCache;
  386. @@ -89,6 +91,7 @@
  387.  
  388. +       StringUtil.printSection("Discord");
  389. +       Discord.init();
  390. +      
  391.         if (Config.ALLOW_WEDDING)
  392.             CoupleManager.getInstance();
  393.        
  394. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatShout.java b/aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatShout.java
  395. index e49d572..115c7f6 100644
  396. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatShout.java
  397. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatShout.java
  398. @@ -1,5 +1,7 @@
  399.  package net.sf.l2j.gameserver.handler.chathandlers;
  400.  
  401. +import net.sf.l2j.discord.Discord;
  402. +import net.sf.l2j.discord.actions.handlers.ChannelMessage;
  403.  import net.sf.l2j.gameserver.data.xml.MapRegionData;
  404.  import net.sf.l2j.gameserver.enums.FloodProtector;
  405.  import net.sf.l2j.gameserver.enums.SayType;
  406. @@ -29,6 +31,8 @@
  407.             if (region == MapRegionData.getInstance().getMapRegion(worldPlayer.getX(), worldPlayer.getY()))
  408.                 worldPlayer.sendPacket(cs);
  409.         }
  410. +      
  411. +       Discord.notify(ChannelMessage.class, COMMAND_IDS[0], player, text);
  412.     }
  413.    
  414.     @Override
  415. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatTrade.java b/aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatTrade.java
  416. index 6945b99..a8a62f2 100644
  417. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatTrade.java
  418. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/handler/chathandlers/ChatTrade.java
  419. @@ -1,5 +1,7 @@
  420.  package net.sf.l2j.gameserver.handler.chathandlers;
  421.  
  422. +import net.sf.l2j.discord.Discord;
  423. +import net.sf.l2j.discord.actions.handlers.ChannelMessage;
  424.  import net.sf.l2j.gameserver.data.xml.MapRegionData;
  425.  import net.sf.l2j.gameserver.enums.FloodProtector;
  426.  import net.sf.l2j.gameserver.enums.SayType;
  427. @@ -29,6 +31,8 @@
  428.             if (region == MapRegionData.getInstance().getMapRegion(worldPlayer.getX(), worldPlayer.getY()))
  429.                 worldPlayer.sendPacket(cs);
  430.         }
  431. +      
  432. +       Discord.notify(ChannelMessage.class, COMMAND_IDS[0], player, text);
  433.     }
  434.    
  435.     @Override
  436.  
  437. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java
  438. index 647ec10..6b6c6b4 100644
  439. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java
  440. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java
  441. @@ -3185,6 +3185,11 @@
  442.         sendPacket(new TradeStart(this));
  443.     }
  444.    
  445. +   public boolean sendDiscordNotifications()
  446. +   {
  447. +       return isGM(); // Change it to your condition like isDonator
  448. +   }
  449. +  
  450.     public void onTradeConfirm(Player partner)
  451.     {
  452.         sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_CONFIRMED_TRADE).addString(partner.getName()));
  453.  
  454. @@ -3221,6 +3227,11 @@
  455.         }
  456.     }
  457.    
  458. +   public static long getDiscordID()
  459. +   {
  460. +       return 0L;
  461. +   }
  462. +  
  463.     public void startTrade(Player partner)
  464.     {
  465.         onTradeStart(partner);
  466.  
  467. @@ -7368,6 +7384,16 @@
  468.         }
  469.     }
  470.    
  471. +   public boolean isDiscordLegend()
  472. +   {
  473. +       return true;
  474. +   }
  475. +  
  476. +   public String getIp()
  477. +   {
  478. +       return getClient().getConnection().getInetAddress().getHostAddress();
  479. +   }
  480. +  
  481.     /**
  482.      * Added to other GMs, test also this {@link Player} instance. If GM, set it.
  483.      */
  484. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/GrandBoss.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/GrandBoss.java
  485. index ca72456..974c662 100644
  486. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/GrandBoss.java
  487. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/GrandBoss.java
  488. @@ -2,6 +2,8 @@
  489.  
  490.  import net.sf.l2j.commons.random.Rnd;
  491.  
  492. +import net.sf.l2j.discord.Discord;
  493. +import net.sf.l2j.discord.actions.handlers.GrandBossDeath;
  494.  import net.sf.l2j.gameserver.data.manager.HeroManager;
  495.  import net.sf.l2j.gameserver.data.manager.RaidPointManager;
  496.  import net.sf.l2j.gameserver.model.actor.Creature;
  497. @@ -61,7 +63,7 @@
  498.                     HeroManager.getInstance().setRBkilled(player.getObjectId(), getNpcId());
  499.             }
  500.         }
  501. -      
  502. +       Discord.notify(GrandBossDeath.class, player, this);
  503.         return true;
  504.     }
  505.    
  506. 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
  507. index 4eab799..30db3c5 100644
  508. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
  509. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
  510. @@ -3,6 +3,8 @@
  511.  import java.util.Map.Entry;
  512.  
  513.  import net.sf.l2j.Config;
  514. +import net.sf.l2j.discord.Discord;
  515. +import net.sf.l2j.discord.actions.handlers.Login;
  516.  import net.sf.l2j.gameserver.communitybbs.manager.MailBBSManager;
  517.  import net.sf.l2j.gameserver.data.SkillTable.FrequentSkill;
  518.  import net.sf.l2j.gameserver.data.manager.CastleManager;
  519. @@ -289,6 +291,9 @@
  520.         if (qs != null)
  521.             qs.getQuest().notifyEvent("UC", null, player);
  522.        
  523. +       if (player.sendDiscordNotifications())
  524. +           Discord.notify(Login.class, player);
  525. +      
  526.         player.sendPacket(ActionFailed.STATIC_PACKET);
  527.     }
RAW Paste Data