Advertisement
Guest User

.epic

a guest
Sep 13th, 2023
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.26 KB | None | 0 0
  1. package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
  2.  
  3. import java.text.SimpleDateFormat;
  4.  
  5. import net.sf.l2j.Config;
  6. import net.sf.l2j.gameserver.data.xml.NpcData;
  7. import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
  8. import net.sf.l2j.gameserver.data.manager.GrandBossManager;
  9. import net.sf.l2j.gameserver.data.manager.RaidBossInfoManager;
  10. import net.sf.l2j.gameserver.model.actor.Player;
  11. import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  12. import net.sf.l2j.commons.data.StatSet;
  13.  
  14.  
  15. public class GrandBossInfo implements IVoicedCommandHandler
  16. {
  17.  
  18. private static final String[] _voicedCommands =
  19. {
  20. "rb"
  21. };
  22.  
  23. private static final int[] raidbosses = new int[]
  24. {
  25. 51006 // Zaken
  26. };
  27.  
  28. private static final int[] GRAND = new int[]
  29. {
  30. 29001, // Queen Ant
  31. 29006, // Core
  32. 29014 // Orfen
  33. };
  34.  
  35. private static final int[] GRAND2 = new int[]
  36. {
  37. 29019, // Antharas
  38. 29028, // Valakas
  39. 29047 // Halisha
  40. };
  41.  
  42. private static final int BAIUM = 29020;
  43.  
  44. @Override
  45. public boolean useVoicedCommand(String command, Player activeChar, String params)
  46. {
  47. if (command.equals("rb") && Config.ENABLE_COMMAND_RB)
  48. {
  49. final StringBuilder sb = new StringBuilder();
  50. NpcHtmlMessage html = new NpcHtmlMessage(0);
  51. for (int raidboss : raidbosses)
  52. {
  53. String name = NpcData.getInstance().getTemplate(raidboss).getName();
  54. long delay = RaidBossInfoManager.getInstance().getRaidBossRespawnTime(raidboss);
  55. sb.append("<html><head><title>Epic Boss Manager</title></head><body>");
  56. sb.append("<center>");
  57. sb.append("<img src=\"L2UI.SquareGray\" width=300 height=1><br>");
  58.  
  59. if (delay <= System.currentTimeMillis())
  60. {
  61. sb.append("" + name + ":&nbsp;<font color=\"4d94ff\">Is Alive!</font><br1>");
  62. }
  63. else
  64. {
  65. sb.append("" + name + ":&nbsp;<br1>");
  66. sb.append("&nbsp;<font color=\"FFFFFF\">" + " " + "Respawn at:</font>" + "" + "<font color=\"FF9900\"> " + new SimpleDateFormat("dd-MM-yyyy HH:mm").format(delay) + "</font><br>");
  67. }
  68. }
  69.  
  70. // Case of Queen/Core/Orfen
  71. for (int grandboss : GRAND)
  72. {
  73. StatSet info = GrandBossManager.getInstance().getStatSet(grandboss);
  74. long temp = info.getLong("respawn_time");
  75. String Grand = NpcData.getInstance().getTemplate(grandboss).getName();
  76.  
  77. sb.append("<center>");
  78. sb.append("<img src=\"L2UI.SquareGray\" width=300 height=1><br>");
  79. if (temp <= System.currentTimeMillis())
  80. {
  81. sb.append("" + Grand + ":&nbsp;<font color=\"4d94ff\">Is Alive!</font><br1>");
  82. }
  83. else
  84. {
  85. sb.append("" + Grand + ":&nbsp;<br1>");
  86. sb.append("&nbsp;<font color=\"FFFFFF\">" + " " + "Respawn at:</font>" + "" + "<font color=\"FF9900\"> " + new SimpleDateFormat("dd-MM-yyyy HH:mm").format(temp) + "</font><br>");
  87. }
  88. }
  89.  
  90. // Case of Baium
  91. StatSet infobaium = GrandBossManager.getInstance().getStatSet(BAIUM);
  92. long tempbaium = infobaium.getLong("respawn_time");
  93. String Baium = NpcData.getInstance().getTemplate(BAIUM).getName();
  94. int BaiumStatus = GrandBossManager.getInstance().getBossStatus(BAIUM);
  95.  
  96. sb.append("<center>");
  97. sb.append("<img src=\"L2UI.SquareGray\" width=300 height=1><br>");
  98. if (tempbaium <= System.currentTimeMillis() && BaiumStatus == 0)
  99. {
  100. sb.append("" + Baium + ":&nbsp;<font color=\"ff4d4d\">Is Asleep!</font><br1>");
  101. }
  102. else if (BaiumStatus == 1)
  103. {
  104. sb.append("" + Baium + ":&nbsp;<font color=\"ff4d4d\">Is Awake and fighting. Entry is locked.</font><br1>");
  105. }
  106. else
  107. {
  108. sb.append("" + Baium + ":&nbsp;<br1>");
  109. sb.append("&nbsp;<font color=\"FFFFFF\">" + " " + "Respawn at:</font>" + "" + "<font color=\"FF9900\"> " + new SimpleDateFormat("dd-MM-yyyy HH:mm").format(tempbaium) + "</font><br>");
  110. }
  111.  
  112. // Case of Antharas/Valakas/Halisha
  113. for (int grandboss : GRAND2)
  114. {
  115. StatSet infogrand = GrandBossManager.getInstance().getStatSet(grandboss);
  116. long tempgrand = infogrand.getLong("respawn_time");
  117. String Grand = NpcData.getInstance().getTemplate(grandboss).getName();
  118. int BossStatus = GrandBossManager.getInstance().getBossStatus(grandboss);
  119.  
  120. sb.append("<center>");
  121. sb.append("<img src=\"L2UI.SquareGray\" width=300 height=1><br>");
  122. if (tempgrand <= System.currentTimeMillis() && BossStatus == 0)
  123. {
  124. sb.append("" + Grand + ":&nbsp;<font color=\"4d94ff\">Is spawned. Entry is unlocked.</font><br1>");
  125. }
  126. else if (BossStatus == 1)
  127. {
  128. sb.append("" + Grand + ":&nbsp;<font color=\"ff4d4d\">Someone has entered. Hurry!</font><br1>");
  129. }
  130. else if (BossStatus == 2)
  131. {
  132. sb.append("" + Grand + ":&nbsp;<font color=\"ff4d4d\">Is engaged in battle. Entry is locked.</font><br1>");
  133. }
  134. else
  135. {
  136. sb.append("" + Grand + ":&nbsp;<br1>");
  137. sb.append("&nbsp;<font color=\"FFFFFF\">" + " " + "Respawn at:</font>" + "" + "<font color=\"FF9900\"> " + new SimpleDateFormat("dd-MM-yyyy HH:mm").format(tempgrand) + "</font><br>");
  138. }
  139. }
  140. html.setHtml(sb.toString());
  141. html.replace("%bosslist%", sb.toString());
  142. activeChar.sendPacket(html);
  143. }
  144. return true;
  145. }
  146.  
  147. @Override
  148. public String[] getVoicedCommandList()
  149. {
  150. return _voicedCommands;
  151. }
  152. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement