Доброго времени суток. Данный NPC делал для своего сервера, но считаю, что вам тоже пригодится.
Вот как выглядит диалог NPC'а:
Скрипт самого NPC (Создаем класс EpicBossManager.java в scripts\custom\core):
/*
* This program 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.
*
* This program 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 custom.core;
import net.sf.l2j.gameserver.datatables.NpcTable;
import net.sf.l2j.gameserver.instancemanager.GrandBossManager;
import net.sf.l2j.gameserver.model.actor.L2Npc;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.quest.Quest;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
public class EpicBossManager extends Quest
{
// ID Вашего NPC который будет использован в качестве менеджера.
// Тип вашего NPC должен быть L2Npc.
private static final int MANAGER = 90001;
// ID Эпик Боссов у которых будет отображено время респавна.
private static final int[] BOSSES = {25512, 29001, 29006, 29014, 29019, 29020, 29028, 29065};
public EpicBossManager(int questid, String name, String descr)
{
super(questid, name, descr);
addFirstTalkId(MANAGER);
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance pc)
{
if(npc == null || pc == null)
return null;
if(npc.getNpcId() == MANAGER)
{
sendInfo(pc);
}
return null;
}
private static void sendInfo(L2PcInstance activeChar)
{
StringBuilder tb = new StringBuilder();
tb.append("<html><body><img src=\"Sek.cbui371\" width=280 height=1><img src=\"town_map.town_map_darkelf_t00\" width=280 height=35/><img src=\"Sek.cbui371\" width=280 height=1><table width=290></table><table width=288 bgcolor=\"000000\"><tr><td align=\"center\"><table width=280><tr><td align=\"center\"><font color=\"LEVEL\">[ Таблица респавна Эпик Боссов ]</font></td><tr></table></td></tr><tr></tr></table><img src=\"Sek.cbui371\" width=280 height=1><br><br><br><br><br><br><br><br><table width=255>");
for(int boss : BOSSES)
{
String name = NpcTable.getInstance().getTemplate(boss).getName();
long delay = GrandBossManager.getStatsSet(boss).getLong("respawn_time");
if (delay <= System.currentTimeMillis())
{
tb.append("<tr><td align=\"center\"><font color=\"00C3FF\">" + name + "</color>: " + "<font color=\"9CC300\">Жив</color></td></tr>");
}
else
{
int hours = (int) ((delay - System.currentTimeMillis()) / 1000 / 60 / 60);
int mins = (int) (((delay - (hours * 60 * 60 * 1000)) - System.currentTimeMillis()) / 1000 / 60);
tb.append("<tr><td align=\"center\"><font color=\"00C3FF\">" + name + "</color>:<br1>" + "<font color=\"FFFFFF\">" +" " + "респавн через </color>" + " " + " <font color=\"32C332\">" + " " + hours + " часа(ов) : " + mins + " минут(ы)"+"</color></td></tr>");
}
}
tb.append("</table><br><br><br><br><br><br><br><img src=\"Sek.cbui371\" width=280 height=1><table width=286 height=26 bgcolor=000000><tr><td align=\"center\"><font color=\"363636\">Название вашего сервера</font></td></tr></table><img src=\"Sek.cbui371\" width=280 height=1></body></html>");
NpcHtmlMessage msg = new NpcHtmlMessage(MANAGER);
msg.setHtml(tb.toString());
activeChar.sendPacket(msg);
}
public static void main(String[] args)
{
new EpicBossManager(-1, "core", "custom");
}
}
Так же помогу вам прикрутить к вашим сборкам.