Examples of QuestState


Examples of lineage2.gameserver.model.quest.QuestState

    int cond = st.getCond();
    if (npcId == Atra)
    {
      if (id == CREATED)
      {
        QuestState qs1 = st.getPlayer().getQuestState(_308_ReedFieldMaintenance.class);
        if ((qs1 != null) && qs1.isStarted())
        {
          return "32647-17.htm";
        }
        if (st.getPlayer().getLevel() < 82)
        {
View Full Code Here

Examples of lineage2.gameserver.model.quest.QuestState

 
  @Override
  public String onTalk(NpcInstance npc, QuestState st)
  {
    String htmltext = "noquest";
    QuestState q = st.getPlayer().getQuestState(_119_LastImperialPrince.class);
    if (q == null)
    {
      return htmltext;
    }
    if (st.getPlayer().getLevel() < 74)
    {
      htmltext = "printessa_spirit_q0654_02.htm";
      st.exitCurrentQuest(true);
      return htmltext;
    }
    else if (!q.isCompleted())
    {
      htmltext = "noquest";
      st.exitCurrentQuest(true);
      return htmltext;
    }
View Full Code Here

Examples of lineage2.gameserver.model.quest.QuestState

  {
    String htmltext = event;
    int cond = st.getCond();
    if (event.equalsIgnoreCase("take_test") && (cond == 0))
    {
      QuestState GoodDayToFly = st.getPlayer().getQuestState(_10273_GoodDayToFly.class);
      if ((GoodDayToFly != null) && GoodDayToFly.isCompleted())
      {
        st.setCond(2);
        st.setState(STARTED);
        st.playSound(SOUND_ACCEPT);
        htmltext = "dilios_q692_4.htm";
View Full Code Here

Examples of lineage2.gameserver.model.quest.QuestState

  }
 
  @Override
  public String onFirstTalk(NpcInstance npc, Player player)
  {
    QuestState qs = player.getQuestState(_186_ContractExecution.class);
    if ((qs != null) && qs.isCompleted() && (player.getQuestState(getClass()) == null))
    {
      newQuestState(player, STARTED);
    }
    return "";
  }
View Full Code Here

Examples of lineage2.gameserver.model.quest.QuestState

    {
      return "subclass_forbidden.htm";
    }
    if (npcId == SirGustavAthebaldt)
    {
      QuestState qs = player.getQuestState(_193_SevenSignDyingMessage.class);
      if ((cond == 0) && (player.getLevel() >= 79) && (qs != null) && qs.isCompleted())
      {
        htmltext = "sirgustavathebaldt_q194_1.htm";
      }
      else if (cond == 1)
      {
View Full Code Here

Examples of net.sf.l2j.gameserver.model.quest.QuestState

        }
       
        //FileInputStream fis = null;
       
        // Get the state of the selected quest
        QuestState qs = player.getQuestState(questId);
       
        if (qs != null)
        {
            // If the quest is alreday started, no need to show a window
            if (!qs.getQuest().notifyTalk(this, qs))
                return;
        }
        else
        {
            if (q != null)
            {
                // check for start point
                Quest[] qlst = getTemplate().getEventQuests(Quest.QuestEventType.QUEST_START);
               
                if (qlst != null && qlst.length > 0)
                {
                    for (int i=0; i < qlst.length; i++)
                    {
                        if (qlst[i] == q)
                        {
                            qs = q.newQuestState(player);
                            //disabled by mr. becouse quest dialog only show on second click.
                            //if(qs.getState().getName().equalsIgnoreCase("completed"))
                            //{
                            if (!qs.getQuest().notifyTalk(this, qs))
                                return; // no need to show a window
                            //}
                            break;
                        }
                    }
                }
            }
        }
       
        if (qs == null)
        {
            // no quests found
            content = "<html><body>You are either not carrying out your quest or don't meet the criteria.</body></html>";
        }
        else
        {
            questId = qs.getQuest().getName();
            String stateId = qs.getStateId();
            String path = "data/jscript/quests/"+questId+"/"+stateId+".htm";
            content = HtmCache.getInstance().getHtm(path); //TODO path for quests html
           
            if (Config.DEBUG)
            {
View Full Code Here

Examples of net.sf.l2j.gameserver.model.quest.QuestState

        for (Quest q : questList)
        {
            writeD(q.getQuestIntId());

            QuestState qs = _activeChar.getQuestState(q.getName());

            if (qs == null)
            {
                writeD(0);
                continue;
            }

            writeD(qs.getInt("cond"));   // stage of quest progress
        }
  }
View Full Code Here

Examples of net.sf.l2j.gameserver.model.quest.QuestState

    writeC(0x80);
    writeH(_quests.length);
    for (Quest q : _quests)
    {
      writeD(q.getQuestIntId());
            QuestState qs = _activeChar.getQuestState(q.getName());
      if(qs == null)
      {
        writeD(0);
                continue;
      }

      int states = qs.getInt("__compltdStateFlags");
      if (states != 0 )
        writeD(states);
      else
        writeD(qs.getInt("cond"));
    }
  }
View Full Code Here

Examples of net.sf.l2j.gameserver.model.quest.QuestState

        return;

        Quest qe = QuestManager.getInstance().getQuest(_questId);
        if (qe != null)
        {
        QuestState qs = activeChar.getQuestState(qe.getName());
            if(qs != null)
            {
            qs.exitQuest(true);
            SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
            sm.addString("Quest aborted.");
                activeChar.sendPacket(sm);
                sm = null;
            QuestList ql = new QuestList();
View Full Code Here

Examples of net.sf.l2j.gameserver.model.quest.QuestState

   * @param event the event
   * @return the quest state
   */
  public QuestState processQuestEvent(String quest, String event)
  {
    QuestState retval = null;
    if (event == null)
    {
      event = "";
    }
    if (!_quests.containsKey(quest))
    {
      return retval;
    }
    QuestState qs = getQuestState(quest);
    if ((qs == null) && (event.length() == 0))
    {
      return retval;
    }
    if (qs == null)
    {
      Quest q = QuestManager.getInstance().getQuest(quest);
      if (q == null)
      {
        return retval;
      }
      qs = q.newQuestState(this);
    }
    if (qs != null)
    {
      if (getLastQuestNpcObject() > 0)
      {
        L2Object object = L2World.getInstance().findObject(getLastQuestNpcObject());
        if ((object instanceof L2NpcInstance) && isInsideRadius(object, L2NpcInstance.INTERACTION_DISTANCE, false, false))
        {
          L2NpcInstance npc = (L2NpcInstance) object;
          QuestState[] states = getQuestsForTalk(npc.getNpcId());
         
          if (states != null)
          {
            for (QuestState state : states)
            {
              if ((state.getQuest().getQuestIntId() == qs.getQuest().getQuestIntId()) && !qs.isCompleted())
              {
                if (qs.getQuest().notifyEvent(event, npc, this))
                {
                  showQuestWindow(quest, qs.getStateId());
                }
               
                retval = qs;
              }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.