Quests problem!

Статус
В этой теме нельзя размещать новые ответы.

byEvanthe

Интересующийся
Участник
Сообщения
103
Розыгрыши
0
Решения
1
Репутация
0
Реакции
6
Баллы
380
Хроники
  1. Chaotic Throne: High Five
Исходники
Присутствуют
Сборка
L2jSunrise
Hello, i have custom quest that spawn the monsters. But after a while ( x time ) mobs don't appear anymore! Can someone take a look of this code and tell me what's wrong ?

Thank you in advance!
JavaScript:
package quests.Q10506_RebirthBall;

import l2r.Config;
import l2r.gameserver.model.Location;
import l2r.gameserver.model.actor.L2Npc;
import l2r.gameserver.model.actor.instance.L2PcInstance;
import l2r.gameserver.model.quest.Quest;
import l2r.gameserver.model.quest.QuestState;
import l2r.gameserver.util.Util;


public final class Q10506_RebirthBall extends Quest
{
    // NPC
    private static final int GHOST_OF_ADVENTURER = Config.NPC_ID;

    // Items Required
    private static final int BROKEN_RELIC_PART = Config.ITEM_ID_FOR_REBIRTH_BALL;

    // Item Count Required
    private static final int REQUIRED_RELIC_COUNT = Config.TOTAL_ITEM_ID_FOR_REBIRTH_BALL;
    // Misc
    private static final int MIN_LEVEL = Config.REQUIRED_LEVEL_TO_ENTER;

    // Teleport Location

    private static final Location TELEPORT_PLAYER = new Location(155299, 19786, -3720, 0);

    // Reward
    private static final int[] REBIRTH_BALL =
            {
                    14880
            };

    // @formatter:off

    // Mobs
    private static final int[] MUTANT_OVERLORD =
            {
                    22736
            };

    // @formatter:on

    public Q10506_RebirthBall()
    {
        super(10506, Q10506_RebirthBall.class.getSimpleName(), "Rebirth Ball");
        addStartNpc(GHOST_OF_ADVENTURER);
        addTalkId(GHOST_OF_ADVENTURER);
        addKillId(MUTANT_OVERLORD);
        registerQuestItems(BROKEN_RELIC_PART);
    }

    @Override
    public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
    {
        final QuestState st = player.getQuestState(getName());
        if (st == null)
        {
            return null;
        }

        String htmltext = null;
        switch (event)
        {
            case "31538-02.html":
            {
                player.teleToLocation(TELEPORT_PLAYER, 0);
                st.startQuest();
                htmltext = event;
                break;
            }
            case "31538-05.html":
            {
                htmltext = event;
                break;
            }

            case "14880": // Rebirth Ball
            {
                if (getQuestItemsCount(player, BROKEN_RELIC_PART) >= REQUIRED_RELIC_COUNT)
                {
                    rewardItems(player, REBIRTH_BALL[getRandom(REBIRTH_BALL.length)], (player.isPremium() && player.isTempPremium()) ? 2 : 1);
                    takeItems(player, BROKEN_RELIC_PART, REQUIRED_RELIC_COUNT);
                    //player.getStat().addLevel((byte) 5);
                    htmltext = event;
                    return "";
                }
                break;
            }

            case "31538-08.html":
            {
                st.exitQuest(true, true);
                htmltext = event;
                break;
            }
        }
        return htmltext;
    }

    @Override
    public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
    {
        final QuestState st = getRandomPartyMemberState(player, -1, 3, npc);
        if (st != null)
        {
            int npcId = npc.getId();
            if (Util.contains(MUTANT_OVERLORD, npcId))
            {
                final int itemCount = ((getRandom(100) < 79) ? 2 : 1);
                giveItemRandomly(player, npc, BROKEN_RELIC_PART, itemCount, 0, 1.00, true);
            }
        }
        return super.onKill(npc, player, isSummon);
    }

    @Override
    public String onTalk(L2Npc npc, L2PcInstance player)
    {
        QuestState st = getQuestState(player, true);
        String htmltext = getNoQuestMsg(player);
        if (st == null)
        {
            return htmltext;
        }

        if (st.isCreated())
        {
            htmltext = ((player.getLevel() >= MIN_LEVEL) ? "31538-01.html" : "31538-03.html");
        }
        else if (st.isStarted())
        {
            htmltext = ((getQuestItemsCount(player, BROKEN_RELIC_PART) >= REQUIRED_RELIC_COUNT) ? "31538-04.html" : "31538-07.html");
        }
        return htmltext;
    }
}
 
Решение
I find something, but i don't know if this is cause. The mobs ID's, it's used in another location
.
Well, i don;t know if this is cause but i will remove it from there. Another thing i don't know if exist

Detected problem. Monster doesn't have the respawn time, at respawn time, it's NONE ! Fixed!
I don’t see any code here that is responsible for the spawning of monsters.
so most likely the problem is not in the quest itself.
 
Can you tell me what can be
?The quest doesn;t work like that. The mobs i spawn manually, i just defined the ID of mobs in quest. In this case, player if kill x monster, he gets the quest ( item ) in inventory

Ad i think i have problem in mob xml. I will take a look and i will come with a response

I's not from npc. Anything else cause this
 
Check if the code that controls the NPC spawn has any restrictions on the number of living creatures at a time. You mentioned that the problem may be related to the XML in which you configure your mobs. Make sure that these IDs correctly match your creatures, and that they are properly configured in the configuration file.
In the onKill method, you need to make sure that you are correctly handling the factors associated with the emergence of new resources. You call giveItemRandomly(), but it's also important to make sure that your system can react by creating new mobs.
Check it out
 
I find something, but i don't know if this is cause. The mobs ID's, it's used in another location
.
Well, i don;t know if this is cause but i will remove it from there. Another thing i don't know if exist

Detected problem. Monster doesn't have the respawn time, at respawn time, it's NONE ! Fixed!
 

Вложения

  • 1732616560532.png
    1732616560532.png
    1,4 КБ · Просмотры: 15
Решение
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху Снизу