Package l2p.gameserver.model.quest

Examples of l2p.gameserver.model.quest.QuestState


          htmltext = "fisher_willeri_q0029_0102.htm";
          st.exitCurrentQuest(true);
        }
        else
        {
          QuestState WilliesSpecialBait = st.getPlayer().getQuestState(_052_WilliesSpecialBait.class);
          if(WilliesSpecialBait != null)
          {
            if(WilliesSpecialBait.isCompleted())
            {
              htmltext = "fisher_willeri_q0029_0101.htm";
            }
            else
            {
View Full Code Here


    int npcId = npc.getNpcId();
    String htmltext = "<html><head><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>";
    int cond = st.getCond();
    if(npcId == Stones)
    {
      QuestState q = st.getPlayer().getQuestState(_114_ResurrectionOfAnOldManager.class);
      if(q == null)
      {
        return htmltext;
      }
      else if(cond == 0)
      {
        if(st.getPlayer().getLevel() >= 50 && q.isCompleted())
        {
          htmltext = "32046-01.htm";
        }
        else
        {
View Full Code Here

    int cond = st.getInt("cond");
    if(npcId == 31740)
    {
      if(cond == 0)
      {
        QuestState previous = st.getPlayer().getQuestState(_242_PossessorOfaPreciousSoul2.class);
        if(previous != null && previous.getState() == COMPLETED && st.getPlayer().getLevel() >= 65)
        {
          htmltext = "caradine_q0246_0101.htm";
        }
        else
        {
View Full Code Here

    return getQuestState(quest.getSimpleName());
  }

  public boolean isQuestCompleted(String quest)
  {
    QuestState q = getQuestState(quest);
    return q != null && q.isCompleted();
  }
View Full Code Here

    return q != null && q.isCompleted();
  }

  public boolean isQuestCompleted(Class<?> quest)
  {
    QuestState q = getQuestState(quest);
    return q != null && q.isCompleted();
  }
View Full Code Here

  {
    if(event == null)
    {
      event = "";
    }
    QuestState qs = getQuestState(quest);
    if(qs == null)
    {
      Quest q = QuestManager.getQuest(quest);
      if(q == null)
      {
        System.out.println("Quest " + quest + " not found!!!");
        return;
      }
      qs = q.newQuestState(this, Quest.CREATED);
    }
    if(qs == null || qs.isCompleted())
    {
      return;
    }
    qs.getQuest().notifyEvent(event, qs, npc);
    sendPacket(new QuestList(this));
  }
View Full Code Here

      if(QuestManager.getQuest(422) != null)
      {
        String qn = QuestManager.getQuest(422).getName();
        if(qn != null)
        {
          QuestState qs = getQuestState(qn);
          if(qs != null)
          {
            qs.exitCurrentQuest(true);
          }
        }
      }
    }
    if(store)
View Full Code Here

  }

  @Override
  public String onEvent(String event, QuestState st, L2NpcInstance npc)
  {
    QuestState qs = st.getPlayer().getQuestState(_255_Tutorial.class);
    if(qs == null)
    {
      return null;
    }
    String htmltext;
    L2Player player = st.getPlayer();
    int Ex = qs.getInt("Ex");
    int classId = player.getClassId().getId();
    if(event.equalsIgnoreCase("TimerEx_NewbieHelper"))
    {
      if(Ex == 0)
      {
        if(player.getClassId().isMage())
        {
          st.playTutorialVoice("tutorial_voice_009b");
        }
        else
        {
          st.playTutorialVoice("tutorial_voice_009a");
        }
        qs.set("Ex", "1");
      }
      else if(Ex == 3)
      {
        st.playTutorialVoice("tutorial_voice_010a");
        qs.set("Ex", "4");
      }
      return null;
    }
    else if(event.equalsIgnoreCase("TimerEx_GrandMaster"))
    {
      if(Ex >= 4)
      {
        st.showQuestionMark(7);
        st.playSound(SOUND_TUTORIAL);
        st.playTutorialVoice("tutorial_voice_025");
      }
      return null;
    }
    else if(event.equalsIgnoreCase("isle"))
    {
      st.addRadar(-119692, 44504, 380);
      player.teleToLocation(-120050, 44500, 360);
      htmltext = "<html><body><br>Go to the <font color=\"LEVEL\">Isle of Souls</font> and meet the <font color=\"LEVEL\">Newbie Guide</font> there to learn a number of important tips. He will also give you an item to assist your development. <br>Follow the direction arrow above your head and it will lead you to the Newbie Guide. Good luck!</body></html>";
    }
    else
    {
      Event e = events.get(event);
      if(e.radarX != 0)
      {
        st.addRadar(e.radarX, e.radarY, e.radarZ);
      }
      htmltext = e.htm;
      if(st.getQuestItemsCount(e.item) > 0)
      {
        st.addExpAndSp(0, 50);
        st.startQuestTimer("TimerEx_GrandMaster", 60000);
        st.takeItems(e.item, 1);
        if(Ex <= 3)
        {
          qs.set("Ex", "4");
        }
        if(classId == e.classId1)
        {
          st.giveItems(e.gift1, e.count1);
          if(e.gift1 == SPIRITSHOT_NOVICE)
View Full Code Here

  public String onFirstTalk(L2NpcInstance npc, L2Player player)
  {
    int npcId = npc.getNpcId();
    if(npcId == 30600 || npcId == 30601 || npcId == 30602 || npcId == 30598 || npcId == 30599 || npcId == 32135)
    {
      QuestState qs = player.getQuestState(_255_Tutorial.class);
      if(qs == null || qs.isCompleted())
      {
        return "";
      }
      if(player.getClassId().isMage() && !player.getClassId().equalsOrChildOf(ClassId.orcMage))
      {
        qs.playTutorialVoice("tutorial_voice_027");
        qs.giveItems(SPIRITSHOT_NOVICE, 100);
      }
      else
      {
        qs.playTutorialVoice("tutorial_voice_026");
        qs.giveItems(SOULSHOT_NOVICE, 200);
      }
      int SCROLL_RECOVERY = 8594;
      qs.giveItems(SCROLL_RECOVERY, 2);
      qs.exitCurrentQuest(false);
    }
    return "";
  }
View Full Code Here

  @Override
  public String onTalk(L2NpcInstance npc, QuestState st)
  {
    L2Player player = st.getPlayer();
    QuestState qs = player.getQuestState(_255_Tutorial.class);
    if(qs == null)
    {
      return null;
    }
    String htmltext = "noquest";
    int npcId = npc.getNpcId();
    int Ex = qs.getInt("Ex");
    int step = st.getInt("step");
    int level = player.getLevel();
    boolean isMage = player.getClassId().isMage() && !player.getClassId().equalsOrChildOf(ClassId.orcMage);
    Talk t = talks.get(npcId);
    if(t == null)
    {
      return null;
    }
    if(level >= 10 && t.npcTyp == 1)
    {
      htmltext = "30575-05.htm";
    }
    else if(!(npcId == 30600 || npcId == 30601 || npcId == 30602 || npcId == 30598 || npcId == 30599 || npcId == 32135))
    {
      if(player.getRace().ordinal() == t.raceId)
      {
        htmltext = t.htmlfiles[0];
        if(t.npcTyp == 1)
        {
          if(step == 0 && Ex < 0)
          {
            qs.set("Ex", "0");
            st.startQuestTimer("TimerEx_NewbieHelper", 30000);
            if(isMage)
            {
              st.set("step", "1");
              st.setState(STARTED);
            }
            else
            {
              htmltext = "30530-01.htm";
              st.set("step", "1");
              st.setState(STARTED);
            }
          }
          else if(step == 1 && st.getQuestItemsCount(t.item) == 0 && Ex <= 2)
          {
            if(st.getQuestItemsCount(BLUE_GEM) > 0)
            {
              st.takeItems(BLUE_GEM, st.getQuestItemsCount(BLUE_GEM));
              st.giveItems(t.item, 1);
              st.set("step", "2");
              qs.set("Ex", "3");
              st.startQuestTimer("TimerEx_NewbieHelper", 30000);
              qs.set("ucMemo", "3");
              if(isMage)
              {
                st.playTutorialVoice("tutorial_voice_027");
                st.giveItems(SPIRITSHOT_NOVICE, 100);
                htmltext = t.htmlfiles[2];
View Full Code Here

TOP

Related Classes of l2p.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.