help for Quest

jocker23

Единомышленник
VIP
Сообщения
61
Розыгрыши
0
Репутация
28
Реакции
2
Баллы
160
Хроники
  1. Prelude
Исходники
Присутствуют
Сборка
L2jMobius
Код:
/*
package quests.Q10127_LeanHowtoFight;

import org.l2jmobius.gameserver.data.xml.TeleportListData;
import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestDialogType;
import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.newquestdata.NewQuestLocation;
import org.l2jmobius.gameserver.model.quest.newquestdata.QuestCondType;
import org.l2jmobius.gameserver.network.serverpackets.quest.ExQuestDialog;
import org.l2jmobius.gameserver.network.serverpackets.quest.ExQuestNotification;

import quests.Q10128_ExperiencethePowerofSoulshots.Q10128_ExperiencethePowerofSoulshots;
import quests.Q10129_ExpeiencethePowerofBlessedSpiritshots.Q10129_ExpeiencethePowerofBlessedSpiritshots;

/**
 * @author Magik
 */
public class Q10127_LeanHowtoFight extends Quest
{
    private static final int QUEST_ID = 10127;
    private static final int[] MONSTERS =
    {
        22324 // Training dummy
    };
  
    public Q10127_LeanHowtoFight()
    {
        super(QUEST_ID);
        addKillId(MONSTERS);
    }
  
    @Override
    public String onAdvEvent(String event, Npc npc, Player player)
    {
        switch (event)
        {
            case "ACCEPT":
            {
                if (!canStartQuest(player))
                {
                    break;
                }
              
                final QuestState questState = getQuestState(player, true);
                if (!questState.isStarted() && !questState.isCompleted())
                {
                    questState.startQuest();
                }
                break;
            }
            case "TELEPORT":
            {
                final QuestState questState = getQuestState(player, false);
                if (questState == null)
                {
                    break;
                }
              
                final NewQuestLocation questLocation = getQuestData().getLocation();
                if (questState.isCond(QuestCondType.STARTED))
                {
                    if (questLocation.getStartLocationId() > 0)
                    {
                        final Location location = TeleportListData.getInstance().getTeleport(questLocation.getStartLocationId()).getLocation();
                        teleportToQuestLocation(player, location);
                    }
                }
                else if (questState.isCond(QuestCondType.DONE) && !questState.isCompleted())
                {
                    if (questLocation.getEndLocationId() > 0)
                    {
                        final Location location = TeleportListData.getInstance().getTeleport(questLocation.getEndLocationId()).getLocation();
                        teleportToQuestLocation(player, location);
                    }
                }
                break;
            }
            case "COMPLETE":
            {
                final QuestState questState = getQuestState(player, false);
                if (questState == null)
                {
                    break;
                }
              
                if (questState.isCond(QuestCondType.DONE) && !questState.isCompleted())
                {
                    questState.exitQuest(false, true);
                  
                    if ((player.getClassId().getId() >= ClassId.SACRED_TEMPLAR_00.getId()) && (player.getClassId().getId() < ClassId.HIGH_ELF_SPIRIT_00.getId()))
                    {
                        final QuestState nextQuestState = player.getQuestState(Q10128_ExperiencethePowerofSoulshots.class.getSimpleName());
                        if (nextQuestState == null)
                        {
                            player.sendPacket(new ExQuestDialog(10128, QuestDialogType.ACCEPT));
                        }
                    }
                    else
                    {
                        final QuestState nextQuestState = player.getQuestState(Q10129_ExpeiencethePowerofBlessedSpiritshots.class.getSimpleName());
                        if (nextQuestState == null)
                        {
                            player.sendPacket(new ExQuestDialog(10129, QuestDialogType.ACCEPT));
                        }
                    }
                }
                break;
            }
        }
      
        return null;
    }
  
    @Override
    public String onFirstTalk(Npc npc, Player player)
    {
        final QuestState questState = getQuestState(player, false);
        if ((questState != null) && !questState.isCompleted())
        {
            if (questState.isCond(QuestCondType.STARTED))
            {
                if (questState.isStarted())
                {
                    questState.setCount(getQuestData().getGoal().getCount());
                    questState.setCond(QuestCondType.DONE);
                    player.sendPacket(new ExQuestDialog(questState.getQuest().getId(), QuestDialogType.END));
                }
            }
            else if (questState.isCond(QuestCondType.DONE))
            {
                player.sendPacket(new ExQuestDialog(questState.getQuest().getId(), QuestDialogType.END));
            }
        }
      
        npc.showChatWindow(player);
        return null;
    }
  
    @Override
    public String onKill(Npc npc, Player killer, boolean isSummon)
    {
        final QuestState questState = getQuestState(killer, false);
        if ((questState != null) && questState.isCond(QuestCondType.STARTED))
        {
            questState.setCount(getQuestData().getGoal().getCount());
            questState.setCond(QuestCondType.DONE);
            killer.sendPacket(new ExQuestNotification(questState));
        }
      
        return super.onKill(npc, killer, isSummon);
    }
}

Can anyone help me?

The code has to read the quest and identify when 1 class goes to a quest, and when another class goes to another quest...

But this is not happening, can anyone help me find out what the error is?
 
This is a list of quests that do not exist in the public version of Moebius. What version is it?

import quests.Q10128_Experience the power of Soul Shot.Q10128_Experience the power of Soul Shot.
import quests.Q10129_Experience the power of the blessed spirit bullet.Q10129_Experience the power of the blessed spirit bullet;

This is the first time I've seen two linked quests like this.
 
Oh, that's cool.
I'm stuck while writing Deaton's first request, so I'm also studying.
Originally, you had to click on a request form to accept the quest, but regardless of what you clicked, it was automatically accepted once it was in your inventory.
So I'm trying to improve.
I am also interested in implementing quests and events.
Sorry for not being able to help you.
 
Could anyone still help me? 2 weeks stuck on the same error... I'm going crazy!

I need to make this work... remembering that everything was created by me using shortcuts from mobius itself.

I can't find the error.

quest 10126 ok
quest 10127 ok
quest 10128 off... and all the others too.
 

Вложения

  • dist.rar
    32,4 КБ · Просмотры: 1
Назад
Сверху Снизу