Package l2p.gameserver.model.quest

Examples of l2p.gameserver.model.quest.QuestState


      Quest q1 = QuestManager.getQuest(_184_NikolasCooperationContract.class);
      if(q1 != null)
      {
        st.giveItems(ADENA_ID, 18100);
        st.addExpAndSp(60000, 3000, true);
        QuestState qs1 = q1.newQuestState(player, STARTED);
        q1.notifyEvent("30621-01.htm", qs1, npc);
        st.playSound(SOUND_MIDDLE);
        st.exitCurrentQuest(false);
      }
      return null;
    }
    else if(event.equalsIgnoreCase("Consideration"))
    {
      Quest q2 = QuestManager.getQuest(_185_NikolasCooperationConsideration.class);
      if(q2 != null)
      {
        st.giveItems(ADENA_ID, 18100);
        QuestState qs2 = q2.newQuestState(st.getPlayer(), STARTED);
        q2.notifyEvent("30621-01.htm", qs2, npc);
        st.playSound(SOUND_MIDDLE);
        st.exitCurrentQuest(false);
      }
      return null;
View Full Code Here


      return Silver_Ice_Crystal_Count > 0 ? "ice_lathe_q0648_03.htm" : "ice_lathe_q0648_02.htm";
    }
    long Black_Ice_Crystal_Count = st.getQuestItemsCount(Black_Ice_Crystal);
    if(npcId == Rafforty)
    {
      QuestState st_115 = st.getPlayer().getQuestState(_115_TheOtherSideOfTruth.class);
      if(st_115 != null && st_115.isCompleted())
      {
        cond = 2;
        st.setCond(2);
        st.playSound(SOUND_MIDDLE);
      }
View Full Code Here

  @Override
  public String onTalk(L2NpcInstance 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

        } else if (hasChatWindow) {
            boolean flag = false;
            Quest[] qlst = getTemplate().getEventQuests(QuestEventType.NPC_FIRST_TALK);
            if (qlst != null && qlst.length > 0) {
                for (Quest element : qlst) {
                    QuestState qs = player.getQuestState(element.getName());
                    if ((qs == null || !qs.isCompleted()) && element.notifyFirstTalk(this, player)) {
                        flag = true;
                    }
                }
            }
            if (!flag) {
View Full Code Here

            showChatWindow(player, "data/html/quest-limit.htm");
            return;
        }
        try {
            // Get the state of the selected quest
            QuestState qs = player.getQuestState(questId);
            if (qs != null) {
                if (qs.isCompleted()) {
                    Functions.show(new CustomMessage("quests.QuestAlreadyCompleted", player), player);
                    return;
                }
                if (qs.getQuest().notifyTalk(this, qs)) {
                    return;
                }
            } else {
                Quest q = QuestManager.getQuest(questId);
                if (q != null) {
                    // check for start point
                    Quest[] qlst = getTemplate().getEventQuests(QuestEventType.QUEST_START);
                    if (qlst != null && qlst.length > 0) {
                        for (Quest element : qlst) {
                            if (element == q) {
                                qs = q.newQuestState(player, Quest.CREATED);
                                if (qs.getQuest().notifyTalk(this, qs)) {
                                    return;
                                }
                                break;
                            }
                        }
View Full Code Here

  {
    if(!checkPlayers(pkilled, pkiller))
    {
      return;
    }
    QuestState st = pkiller.getQuestState(q.getClass());
    if(st == null)
    {
      st = q.newQuestState(pkiller, Quest.CREATED);
    }
    if(st.getState() == CREATED || st.getState() == COMPLETED && st.getInt("doneDate") != Calendar.getInstance().get(Calendar.DAY_OF_YEAR))
    {
      st.setState(STARTED);
      st.setCond(1);
      st.set("max", Rnd.get(RANDOM_MIN, RANDOM_MAX));
      st.set("kill", 0);
      st.addNotifyOfPlayerKill();
    }
  }
View Full Code Here

        if(player.getLevel() < 79)
        {
          st.exitCurrentQuest(true);
          return "32593-00.htm";
        }
        QuestState qs = player.getQuestState("_196_SevenSignSealOfTheEmperor");
        if(qs == null)
        {
          return null;
        }
        if(qs.isCompleted() && id == CREATED)
        {
          return "32593-01.htm";
        }
        else if(cond == 1)
        {
View Full Code Here

      {
        oldTrained.doDespawn();
      }
      L2NpcTemplate template = NpcTable.getTemplate(nextNpcId);
      L2TamedBeastInstance nextNpc = new L2TamedBeastInstance(IdFactory.getInstance().getNextId(), template, player, food == 0 ? SKILL_GOLDEN_SPICE : SKILL_CRYSTAL_SPICE, getLoc());
      QuestState st = player.getQuestState("_020_BringUpWithLove");
      if(st != null && Rnd.chance(5) && st.getQuestItemsCount(7185) == 0)
      {
        st.giveItems(7185, 1);
        st.set("cond", "2");
      }
      // also, perform a rare random chat
      int rand = Rnd.get(10);
      if(rand <= 4)
      {
View Full Code Here

  }

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

    }
    if(!st.getPlayer().equals(clan_leader) && clan_leader.getDistance(npc) > Config.ALT_PARTY_DISTRIBUTION_RANGE)
    {
      return null;
    }
    QuestState qs = clan_leader.getQuestState(getName());
    if(qs == null || !qs.isStarted() || qs.getInt("cond") != 1)
    {
      return null;
    }
    int raid = REWARDS_LIST[st.getInt("raid")][0];
    int item = REWARDS_LIST[st.getInt("raid")][1];
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.