Package net.sf.l2j.gameserver.model.quest

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


        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

    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

        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

   * @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

    rewardSkills();
    restoreEffects();
    sendPacket(new EtcStatusUpdate(this));
   
    // if player has quest 422: Repent Your Sins, remove it
    QuestState st = getQuestState("422_RepentYourSins");
   
    if (st != null)
    {
      st.exitQuest(true);
    }
   
    for (int i = 0; i < 3; i++)
    {
      _henna[i] = null;
View Full Code Here

                     * If they both exist, remove both unique items and continue with adding the sub-class.
                     */
                    if (!Config.ALT_GAME_SUBCLASS_WITHOUT_QUESTS)
                    {

                      QuestState qs = player.getQuestState("235_MimirsElixir");
                      if(qs == null || !qs.isCompleted())
                        {
                            player.sendMessage("You must have completed the Mimir's Elixir quest to continue adding your sub class.");
                            return;
                        }
                      qs = player.getQuestState("234_FatesWhisper");
                      if(qs == null || !qs.isCompleted())
                        {
                            player.sendMessage("You must have completed the Fate's Whisper quest to continue adding your sub class.");
                            return;
                        }
                    }
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.model.quest.QuestState

Copyright © 2018 www.massapicom. 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.