Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P Dream_GameServer
- Index: src/com/dream/Config.java
- ===================================================================
- --- src/com/dream/Config.java (revision 1783)
- +++ src/com/dream/Config.java (working copy)
- @@ -91,6 +91,14 @@
- public static boolean GRIDS_ALWAYS_ON;
- public static String PROTECTED_ITEMS;
- public static FastList<Integer> LIST_PROTECTED_ITEMS = new FastList<>();
- + public static String GRAND_BOSS;
- + public static FastList<Integer> GRAND_BOSS_LIST = new FastList<>();
- public static Pattern CNAME_PATTERN;
- public static Pattern PET_NAME_PATTERN;
- @@ -210,13 +215,28 @@
- LIST_PROTECTED_ITEMS = new FastList<>();
- for (String id : PROTECTED_ITEMS.trim().split(","))
- {
- LIST_PROTECTED_ITEMS.add(Integer.parseInt(id.trim()));
- }
- + GRAND_BOSS = altSettings.getProperty("GrandBossList");
- + GRAND_BOSS_LIST = new FastList<>();
- + for (String id : GRAND_BOSS.trim().split(","))
- + {
- + GRAND_BOSS_LIST.add(Integer.parseInt(id.trim()));
- + }
- Index: src/com/dream/game/handler/VoicedCommandHandler.java
- ===================================================================
- --- src/com/dream/game/handler/VoicedCommandHandler.java (revision 1754)
- +++ src/com/dream/game/handler/VoicedCommandHandler.java (working copy)
- @@ -2,6 +2,7 @@
- import javolution.util.FastMap;
- +import com.dream.game.handler.voicedcommand.BossInfo;
- import com.dream.game.handler.voicedcommand.Help;
- public class VoicedCommandHandler
- @@ -25,6 +26,7 @@
- Help h = new Help();
- registerVoicedCommandHandler(h);
- _datatable.put("devinfo", h);
- + registerVoicedCommandHandler(new BossInfo());
- }
- public void registerVoicedCommandHandler(IVoicedCommandHandler handler)
- Index: src/com/dream/game/handler/voicedcommand/BossInfo.java
- ===================================================================
- --- src/com/dream/game/handler/voicedcommand/BossInfo.java (revision 0)
- +++ src/com/dream/game/handler/voicedcommand/BossInfo.java (working copy)
- @@ -0,0 +1,55 @@
- +package com.dream.game.handler.voicedcommand;
- +
- +import javolution.text.TextBuilder;
- +
- +import com.dream.Config;
- +import com.dream.game.datatables.sql.NpcTable;
- +import com.dream.game.handler.IVoicedCommandHandler;
- +import com.dream.game.manager.GrandBossManager;
- +import com.dream.game.model.actor.instance.L2PcInstance;
- +import com.dream.game.network.serverpackets.NpcHtmlMessage;
- +
- +public class BossInfo implements IVoicedCommandHandler
- +{
- + private static final String[] VOICED_COMMANDS =
- + {
- + "bossinfo"
- + };
- +
- + @Override
- + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
- + {
- + TextBuilder tb = new TextBuilder();
- + NpcHtmlMessage msg = new NpcHtmlMessage(5);
- + tb.append("<html><title>Grand Boss</title><body><br><center>");
- + tb.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>");
- +
- + for (int boss : Config.GRAND_BOSS_LIST)
- + {
- + String name = NpcTable.getInstance().getTemplate(boss).getName();
- + long delay = GrandBossManager.getInstance().getStatsSet(boss).getLong("respawn_time");
- + if (delay <= System.currentTimeMillis())
- + {
- + tb.append("<font color=\"00C3FF\">" + name + "</color>: " + "<font color=\"9CC300\">Is Alive</color>" + "<br1>");
- + }
- + else
- + {
- + int hours = (int) ((delay - System.currentTimeMillis()) / 1000 / 60 / 60);
- + int mins = (int) (((delay - (hours * 60 * 60 * 1000)) - System.currentTimeMillis()) / 1000 / 60);
- + int seconts = (int) (((delay - ((hours * 60 * 60 * 1000) + (mins * 60 * 1000))) - System.currentTimeMillis()) / 1000);
- + tb.append("<font color=\"00C3FF\">" + name + "</color>" + "<font color=\"FFFFFF\">" + " " + "Respawn in :</color>" + " " + " <font color=\"32C332\">" + hours + " : " + mins + " : " + seconts + "</color><br1>");
- + }
- + }
- +
- + tb.append("<br><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>");
- + tb.append("</center></body></html>");
- + msg.setHtml(tb.toString());
- + activeChar.sendPacket(msg);
- + }
- +
- + @Override
- + public String[] getVoicedCommandList()
- + {
- + return VOICED_COMMANDS;
- + }
- +
- +}
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement