Advertisement
WallisTeer

bosscomando

Nov 12th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.17 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P Dream_GameServer
  3. Index: src/com/dream/Config.java
  4. ===================================================================
  5. --- src/com/dream/Config.java (revision 1783)
  6. +++ src/com/dream/Config.java (working copy)
  7. @@ -91,6 +91,14 @@
  8. public static boolean GRIDS_ALWAYS_ON;
  9. public static String PROTECTED_ITEMS;
  10. public static FastList<Integer> LIST_PROTECTED_ITEMS = new FastList<>();
  11. + public static String GRAND_BOSS;
  12. + public static FastList<Integer> GRAND_BOSS_LIST = new FastList<>();
  13. public static Pattern CNAME_PATTERN;
  14. public static Pattern PET_NAME_PATTERN;
  15. @@ -210,13 +215,28 @@
  16.  
  17. LIST_PROTECTED_ITEMS = new FastList<>();
  18. for (String id : PROTECTED_ITEMS.trim().split(","))
  19. {
  20. LIST_PROTECTED_ITEMS.add(Integer.parseInt(id.trim()));
  21. }
  22.  
  23. + GRAND_BOSS = altSettings.getProperty("GrandBossList");
  24. + GRAND_BOSS_LIST = new FastList<>();
  25. + for (String id : GRAND_BOSS.trim().split(","))
  26. + {
  27. + GRAND_BOSS_LIST.add(Integer.parseInt(id.trim()));
  28. + }
  29. Index: src/com/dream/game/handler/VoicedCommandHandler.java
  30. ===================================================================
  31. --- src/com/dream/game/handler/VoicedCommandHandler.java (revision 1754)
  32. +++ src/com/dream/game/handler/VoicedCommandHandler.java (working copy)
  33. @@ -2,6 +2,7 @@
  34.  
  35. import javolution.util.FastMap;
  36.  
  37. +import com.dream.game.handler.voicedcommand.BossInfo;
  38. import com.dream.game.handler.voicedcommand.Help;
  39.  
  40. public class VoicedCommandHandler
  41. @@ -25,6 +26,7 @@
  42. Help h = new Help();
  43. registerVoicedCommandHandler(h);
  44. _datatable.put("devinfo", h);
  45. + registerVoicedCommandHandler(new BossInfo());
  46. }
  47.  
  48. public void registerVoicedCommandHandler(IVoicedCommandHandler handler)
  49. Index: src/com/dream/game/handler/voicedcommand/BossInfo.java
  50. ===================================================================
  51. --- src/com/dream/game/handler/voicedcommand/BossInfo.java (revision 0)
  52. +++ src/com/dream/game/handler/voicedcommand/BossInfo.java (working copy)
  53. @@ -0,0 +1,55 @@
  54. +package com.dream.game.handler.voicedcommand;
  55. +
  56. +import javolution.text.TextBuilder;
  57. +
  58. +import com.dream.Config;
  59. +import com.dream.game.datatables.sql.NpcTable;
  60. +import com.dream.game.handler.IVoicedCommandHandler;
  61. +import com.dream.game.manager.GrandBossManager;
  62. +import com.dream.game.model.actor.instance.L2PcInstance;
  63. +import com.dream.game.network.serverpackets.NpcHtmlMessage;
  64. +
  65. +public class BossInfo implements IVoicedCommandHandler
  66. +{
  67. + private static final String[] VOICED_COMMANDS =
  68. + {
  69. + "bossinfo"
  70. + };
  71. +
  72. + @Override
  73. + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
  74. + {
  75. + TextBuilder tb = new TextBuilder();
  76. + NpcHtmlMessage msg = new NpcHtmlMessage(5);
  77. + tb.append("<html><title>Grand Boss</title><body><br><center>");
  78. + tb.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>");
  79. +
  80. + for (int boss : Config.GRAND_BOSS_LIST)
  81. + {
  82. + String name = NpcTable.getInstance().getTemplate(boss).getName();
  83. + long delay = GrandBossManager.getInstance().getStatsSet(boss).getLong("respawn_time");
  84. + if (delay <= System.currentTimeMillis())
  85. + {
  86. + tb.append("<font color=\"00C3FF\">" + name + "</color>: " + "<font color=\"9CC300\">Is Alive</color>" + "<br1>");
  87. + }
  88. + else
  89. + {
  90. + int hours = (int) ((delay - System.currentTimeMillis()) / 1000 / 60 / 60);
  91. + int mins = (int) (((delay - (hours * 60 * 60 * 1000)) - System.currentTimeMillis()) / 1000 / 60);
  92. + int seconts = (int) (((delay - ((hours * 60 * 60 * 1000) + (mins * 60 * 1000))) - System.currentTimeMillis()) / 1000);
  93. + tb.append("<font color=\"00C3FF\">" + name + "</color>" + "<font color=\"FFFFFF\">" + " " + "Respawn in :</color>" + " " + " <font color=\"32C332\">" + hours + " : " + mins + " : " + seconts + "</color><br1>");
  94. + }
  95. + }
  96. +
  97. + tb.append("<br><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>");
  98. + tb.append("</center></body></html>");
  99. + msg.setHtml(tb.toString());
  100. + activeChar.sendPacket(msg);
  101. + }
  102. +
  103. + @Override
  104. + public String[] getVoicedCommandList()
  105. + {
  106. + return VOICED_COMMANDS;
  107. + }
  108. +
  109. +}
  110. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement