L2JLisvus

Would you like to react to this message? Create an account in a few clicks or log in to continue.

3 posters

    [SHARE] Grandboss Status & Respawn time voiced command. [UPDATED]

    jmd
    jmd


    Posts : 56
    Join date : 2013-03-07
    Age : 32
    Location : Greece

    [SHARE] Grandboss Status & Respawn time voiced command. [UPDATED] Empty [SHARE] Grandboss Status & Respawn time voiced command. [UPDATED]

    Post  jmd 2nd July 2017, 11:59

    UPDATED 18/11/2019 - No more mess and a small update to work with latest version of the pack.

    [SHARE] Grandboss Status & Respawn time voiced command. [UPDATED] MB6lbGh

    https://gist.github.com/JMD13/38d1eac0635aa504833d4c53b3a5d5cc

    Code:
    diff --git a/Lisvus_GameServer/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java b/Lisvus_GameServer/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
    index 533fb58..b2455d2 100644
    --- a/Lisvus_GameServer/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
    +++ b/Lisvus_GameServer/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
    @@ -21,6 +21,7 @@
     import net.sf.l2j.Config;
     import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Banking;
     import net.sf.l2j.gameserver.handler.voicedcommandhandlers.ChangePassword;
    +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Epic;
     import net.sf.l2j.gameserver.handler.voicedcommandhandlers.TvTCommand;
     import net.sf.l2j.gameserver.handler.voicedcommandhandlers.VoiceExperience;
     import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Wedding;
    @@ -51,6 +52,7 @@
     {
     registerVoicedCommandHandler(new Banking());
     registerVoicedCommandHandler(new ChangePassword());
    + registerVoicedCommandHandler(new Epic());
     registerVoicedCommandHandler(new TvTCommand());
     registerVoicedCommandHandler(new VoiceExperience());
     registerVoicedCommandHandler(new Wedding());
    diff --git a/Lisvus_GameServer/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Epic.java b/Lisvus_GameServer/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Epic.java
    new file mode 100644
    index 0000000..9e503d4
    --- /dev/null
    +++ b/Lisvus_GameServer/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Epic.java
    @@ -0,0 +1,105 @@
    +/*
    + * Copyright (C) 2004-2014 L2J DataPack
    + *
    + * This file is part of L2J DataPack.
    + *
    + * L2J DataPack is free software: you can redistribute it and/or modify
    + * it under the terms of the GNU General Public License as published by
    + * the Free Software Foundation, either version 3 of the License, or
    + * (at your option) any later version.
    + *
    + * L2J DataPack is distributed in the hope that it will be useful,
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    + * General Public License for more details.
    + *
    + * You should have received a copy of the GNU General Public License
    + * along with this program. If not, see <http://www.gnu.org/licenses/>.
    + */
    +package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
    +
    +import java.text.SimpleDateFormat;
    +import java.util.Date;
    +import java.util.logging.Logger;
    +
    +import net.sf.l2j.gameserver.datatables.NpcTable;
    +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
    +import net.sf.l2j.gameserver.instancemanager.GrandBossManager;
    +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
    +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
    +import net.sf.l2j.gameserver.templates.StatsSet;
    +
    +/**
    + * @author JMD.
    + */
    +
    +public class Epic implements IVoicedCommandHandler
    +{
    + static final Logger _log = Logger.getLogger(Epic.class.getName());
    + private static final String[] VOICED_COMMANDS =
    + {
    + "epic"
    + };
    +
    + @Override
    + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
    + {
    + if (command.startsWith("epic"))
    + {
    + return Status(activeChar);
    + }
    + return false;
    + }
    +
    + public boolean Status(L2PcInstance activeChar)
    + {
    +
    + int[] BOSSES =
    + {
    + 12001,
    + 12052,
    + 12169,
    + 12211,
    + 12372,
    + 12374,
    + 12899,
    +
    + };
    + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
    + final StringBuilder replyMSG = new StringBuilder("<html><body><center>");
    + replyMSG.append("<font color="LEVEL">* Grand Boss Status & Respawn Time *</font><br>");
    + for (int boss : BOSSES)
    + {
    + String name = NpcTable.getInstance().getTemplate(boss).name;
    + StatsSet stats = GrandBossManager.getInstance().getStatsSet(boss);
    + if (stats == null)
    + {
    + replyMSG.append("Stats for GrandBoss " + boss + " not found!<br>");
    + continue;
    + }
    +
    + long delay = stats.getLong("respawn_time");
    + long currentTime = System.currentTimeMillis();
    + if (delay <= currentTime)
    + {
    + replyMSG.append("(" + name + ") is <font color="00FF00">Alive</font><br>");
    +
    + }
    + else
    + {
    + replyMSG.append("(" + name + ") is <font color="FF0000">Dead</font> <font color="FF9900">( " + sdf.format(new Date(delay)) + " )</font><br>");
    + }
    + }
    + replyMSG.append("</center></body></html>");
    + final NpcHtmlMessage adminReply = new NpcHtmlMessage(0);
    + adminReply.setHtml(replyMSG.toString());
    + activeChar.sendPacket(adminReply);
    + return true;
    + }
    +
    + @Override
    + public String[] getVoicedCommandList()
    + {
    + return VOICED_COMMANDS;
    + }
    +}
    \ No newline at end of file

    If you done everything right then just type .epic ingame.


    Last edited by jmd on 18th November 2019, 13:18; edited 3 times in total
    Karakan
    Karakan


    Posts : 756
    Join date : 2013-10-04

    [SHARE] Grandboss Status & Respawn time voiced command. [UPDATED] Empty Re: [SHARE] Grandboss Status & Respawn time voiced command. [UPDATED]

    Post  Karakan 2nd July 2017, 12:51

    Nice share! Cool
    SCRASH0
    SCRASH0


    Posts : 203
    Join date : 2019-03-07

    [SHARE] Grandboss Status & Respawn time voiced command. [UPDATED] Empty Re: [SHARE] Grandboss Status & Respawn time voiced command. [UPDATED]

    Post  SCRASH0 8th June 2019, 02:31

    how do i put raid boss too
    jmd
    jmd


    Posts : 56
    Join date : 2013-03-07
    Age : 32
    Location : Greece

    [SHARE] Grandboss Status & Respawn time voiced command. [UPDATED] Empty Re: [SHARE] Grandboss Status & Respawn time voiced command. [UPDATED]

    Post  jmd 18th November 2019, 13:16

    updated to work with latest version of the server.
    SCRASH0
    SCRASH0


    Posts : 203
    Join date : 2019-03-07

    [SHARE] Grandboss Status & Respawn time voiced command. [UPDATED] Empty Re: [SHARE] Grandboss Status & Respawn time voiced command. [UPDATED]

    Post  SCRASH0 27th November 2019, 23:50

    Can't put it to raid boss too?

    Sponsored content


    [SHARE] Grandboss Status & Respawn time voiced command. [UPDATED] Empty Re: [SHARE] Grandboss Status & Respawn time voiced command. [UPDATED]

    Post  Sponsored content


      Current date/time is 19th May 2024, 11:29