Форум администраторов игровых серверов

Форум администраторов игровых серверов (https://forum.zone-game.info/TT.php)
-   Lineage II (https://forum.zone-game.info/forumdisplay.php?f=34)
-   -   Переделка Grand Boss Status Под Скорию (https://forum.zone-game.info/showthread.php?t=9068)

RaZoR.eXe 13.07.2010 22:19

Переделка Grand Boss Status Под Скорию
 
Нашёл в нете нпц который показывает статус епик босов, но он заточен под l2jserver.

Этот файлик заливается в data\scripts\custom\BossRespawn, и потом прописывается в scripts.cfg
Только вот нужно переделать под Скорию

BossRespawn.java

Код:

/*
 * 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.BossRespawn;


import javolution.text.TextBuilder;

import com.l2jserver.gameserver.instancemanager.GrandBossManager;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jserver.gameserver.datatables.NpcTable;

public class BossRespawn extends Quest
{
        private static final int NPC_ID = 93000;
        private static final int[] BOSSES = {29001, 29006, 29014, 29019, 29020, 29022, 29028, 29045};

        public BossRespawn(int questid, String name, String descr)
        {
                super(questid, name, descr);
                addFirstTalkId(NPC_ID);
        }
       
        public String onFirstTalk(L2Npc npc, L2PcInstance pc)
        {
                if(npc == null || pc == null)
                        return null;

                if(npc.getNpcId() == NPC_ID)
                {
                        sendInfo(pc);
                }
                        return null;
        }

        private void sendInfo(L2PcInstance activeChar)
        {
                TextBuilder tb = new TextBuilder();
                tb.append("<html><title>Grand Boss Info By Dleogr</title><body><br><center>");
                tb.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>");

                for(int boss : BOSSES)
                {
                        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>");
               
                NpcHtmlMessage msg = new NpcHtmlMessage(NPC_ID);
                msg.setHtml(tb.toString());
                activeChar.sendPacket(msg);
        }

        public static void main(String[] args)
        {
                new BossRespawn(-1, "BossRespawn", "custom");
        }
}

--------------------------------

Импорты сменил, и ещё в одном месте L2Npc поменял L2NpcInstance.
Загружает без ошибок.

Весь файл выглядит так:

Код:

/*
 * 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.BossRespawn;


import javolution.text.TextBuilder;

import com.l2scoria.gameserver.managers.GrandBossManager;
import com.l2scoria.gameserver.model.actor.instance.L2NpcInstance;
import com.l2scoria.gameserver.model.actor.instance.L2PcInstance;
import com.l2scoria.gameserver.model.quest.Quest;
import com.l2scoria.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2scoria.gameserver.datatables.sql.NpcTable;

public class BossRespawn extends Quest
{
        private static final int NPC_ID = 93000;
        private static final int[] BOSSES = {29001, 29006, 29014, 29019, 29020, 29022, 29028, 29045};

        public BossRespawn(int questid, String name, String descr)
        {
                super(questid, name, descr);
                addFirstTalkId(NPC_ID);
        }
       
        public String onFirstTalk(L2NpcInstance npc, L2PcInstance pc)
        {
                if(npc == null || pc == null)
                        return null;

                if(npc.getNpcId() == NPC_ID)
                {
                        sendInfo(pc);
                }
                        return null;
        }

        private void sendInfo(L2PcInstance activeChar)
        {
                TextBuilder tb = new TextBuilder();
                tb.append("<html><title>Grand Boss Info By Dleogr</title><body><br><center>");
                tb.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>");

                for(int boss : BOSSES)
                {
                        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>");
               
                NpcHtmlMessage msg = new NpcHtmlMessage(NPC_ID);
                msg.setHtml(tb.toString());
                activeChar.sendPacket(msg);
        }

        public static void main(String[] args)
        {
                new BossRespawn(-1, "BossRespawn", "custom");
        }
}

Когда говорю с нпц, выкидывает Script Error, а в консоли еррор:
http://s57.radikal.ru/i156/1007/9a/664227a40acft.jpg

Что нужно ещё поменять чтобы на Скории заработал?
Благодарю.

incognito 14.07.2010 00:01

Re: Переделка Grand Boss Status Под Скорию
 
на сесте могу проверить и если что выложить готовый вариант=)

RaZoR.eXe 14.07.2010 11:24

Re: Переделка Grand Boss Status Под Скорию
 
Цитата:

Сообщение от incognito (Сообщение 79185)
на сесте могу проверить и если что выложить готовый вариант=)

Благодарю.
А СЕСТ это и есть Скория)

incognito 16.07.2010 18:12

Re: Переделка Grand Boss Status Под Скорию
 
Цитата:

Сообщение от RaZoR.eXe (Сообщение 79214)
Благодарю.
А СЕСТ это и есть Скория)

Вот погнал,но почему на последнем закрытом сесте- показывает только AK наверн из-за того что серв тестовый и бегаю 1 один...
Код:

/*
 * 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.BossRespawn;

import javolution.text.TextBuilder;

import com.l2scoria.gameserver.datatables.sql.NpcTable;
import com.l2scoria.gameserver.managers.GrandBossManager;
import com.l2scoria.gameserver.model.actor.instance.L2NpcInstance;
import com.l2scoria.gameserver.model.actor.instance.L2PcInstance;
import com.l2scoria.gameserver.model.quest.Quest;
import com.l2scoria.gameserver.model.quest.State;
import com.l2scoria.gameserver.network.la2.out.NpcHtmlMessage;

public class BossRespawn extends Quest
{
        public int NPC_ID = 93000;
        public int[] BOSSES = {29001, 29006, 29014, 29019, 29020, /*29022, 29028,*/ 29045};

        private State CREATED;

        public BossRespawn(int questid, String name, String descr)
        {
                super(questid, name, descr);
                CREATED = new State("Start", this);
                this.setInitialState(CREATED);
               
                addStartNpc(NPC_ID);
                addFirstTalkId(NPC_ID);
        }
       
        private void sendInfo(L2NpcInstance npc, L2PcInstance player)
        {
                TextBuilder tb = new TextBuilder("<html><title>Grand Boss Info By Dleogr</title><body><br><center>");
                tb.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>");
                for(int boss : BOSSES)
                {
                        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>");
               
                        NpcHtmlMessage msg = new NpcHtmlMessage(npc.getObjectId());
                        msg.setHtml(tb.toString());
                        player.sendPacket(msg);
                }
        }
       
        public String onFirstTalk(L2NpcInstance npc, L2PcInstance player)
        {
                if(npc == null || player == null)
                        return null;
                if(npc.getNpcId() == NPC_ID)
                {
                        sendInfo(npc, player);
                }
                return null;
        }

        public static void main(String[] args)
        {
                new BossRespawn(-1, "BossRespawn", "custom");
        }
}


incognito 18.07.2010 02:49

Re: Переделка Grand Boss Status Под Скорию
 
хоть бы спасибо кто сказал=)

RaZoR.eXe 19.07.2010 16:13

Re: Переделка Grand Boss Status Под Скорию
 
Благодарю.
Бегу проверять

Добавлено через 36 минут
На СЕСТ 99 не работало.

Нужно было
import com.l2scoria.gameserver.network.la2.out.NpcHtmlMes sage;
сменить на
import com.l2scoria.gameserver.network.serverpackets.NpcH tmlMessage;
и так все загружает.

У вас файл лежит в custom или quests папке?

Open-Shadow 19.07.2010 17:59

Re: Переделка Grand Boss Status Под Скорию
 
Цитата:

Сообщение от RaZoR.eXe (Сообщение 79878)
У вас файл лежит в custom или quests папке?

package custom.BossRespawn;

Значит в кастом.

RaZoR.eXe 19.07.2010 18:06

Re: Переделка Grand Boss Status Под Скорию
 
когда говорю с нпц, ничего не выдает.
может тут нужно в 93000.htm прописать?
по стандартному скрипту сразу говорило но ерроры кидало

incognito 21.07.2010 17:37

Re: Переделка Grand Boss Status Под Скорию
 
ну я пробовал на закрытом сесте и чуть другой вариант а так да если у непися нету страницы он сначала скрипт показывает оч быстро и затем дефолтную страницу.За импорты сори забыл поменять.я делал не через firsttalk a через talk и ссылку на скрипт но показывал только АК...

RaZoR.eXe 21.07.2010 18:17

Re: Переделка Grand Boss Status Под Скорию
 
жалко(
а должен показывать всех которые вписаны


Текущее время: 20:53. Часовой пояс GMT +3.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. Перевод: zCarot