Package l2p.gameserver.model.quest

Examples of l2p.gameserver.model.quest.QuestState


      showHtmlFile(player, npcId + "-NL.htm", npc, null);
      return;
    }
    for(L2Player mem : player.getParty().getPartyMembers())
    {
      QuestState qs = mem.getQuestState(QUEST_ID);
      if(qs == null || !qs.isStarted() && !qs.isCompleted())
      {
        showHtmlFile(player, npcId + "-NS.htm", npc, mem);
        return;
      }
      if(mem.getInventory().getItemByItemId(ENTRANCE_PASS) == null)
View Full Code Here


      if(q != null)
      {
        String qn = q.getName();
        if(player.getClan() != null && player.getClan().getLeader().isOnline() && player.getClan().getLeader().getPlayer().getQuestState(qn) != null)
        {
          QuestState st = player.getClan().getLeader().getPlayer().getQuestState(qn);
          st.getQuest().onKill(this, st);
        }
      }
    }
    unspawnMinions();
    int boxId = 0;
View Full Code Here

            {
              if(isRaid() || quest.getParty() == Quest.PARTY_ALL) // если цель рейд или квест для всей пати награждаем всех участников
              {
                for(L2Player pl : players)
                {
                  QuestState qs = pl.getQuestState(quest.getName());
                  if(qs != null && !qs.isCompleted())
                  {
                    quest.notifyKill(this, qs);
                  }
                }
                toReward = null;
              }
              else
              { // иначе выбираем одного
                GArray<L2Player> interested = new GArray<L2Player>(players.size());
                for(L2Player pl : players)
                {
                  QuestState qs = pl.getQuestState(quest.getName());
                  if(qs != null && !qs.isCompleted()) // из тех, у кого взят квест
                  {
                    interested.add(pl);
                  }
                }
                if(interested.isEmpty())
                {
                  continue;
                }
                toReward = interested.get(Rnd.get(interested.size()));
                if(toReward == null)
                {
                  toReward = killer;
                }
              }
            }
            if(toReward != null)
            {
              QuestState qs = toReward.getQuestState(quest.getName());
              if(qs != null && !qs.isCompleted())
              {
                quest.notifyKill(this, qs);
              }
            }
          }
View Full Code Here

    if(player == null)
    {
      return;
    }
    Quest q = QuestManager.getQuest("_234_FatesWhisper");
    QuestState qs = player.getQuestState(q.getClass());
    if(qs != null)
    {
      qs.exitCurrentQuest(true);
    }
    q.newQuestState(player, Quest.COMPLETED);
    if(player.getRace() == Race.kamael)
    {
      q = QuestManager.getQuest("_236_SeedsOfChaos");
      qs = player.getQuestState(q.getClass());
      if(qs != null)
      {
        qs.exitCurrentQuest(true);
      }
      q.newQuestState(player, Quest.COMPLETED);
    }
    else
    {
      q = QuestManager.getQuest("_235_MimirsElixir");
      qs = player.getQuestState(q.getClass());
      if(qs != null)
      {
        qs.exitCurrentQuest(true);
      }
      q.newQuestState(player, Quest.COMPLETED);
    }
  }
View Full Code Here

  private boolean cmd_Clear(Quest _quest, String[] wordList, L2Player activeChar)
  {
    // quest id|name CLEAR [target]
    L2Player targetChar = getTargetChar(wordList, 3, activeChar);
    QuestState qs = targetChar.getQuestState(_quest.getName());
    if(qs == null)
    {
      activeChar.sendMessage("Player " + targetChar.getName() + " havn't Quest [" + _quest.getName() + "]");
      return false;
    }
    qs.exitCurrentQuest(true);
    return ShowQuestList(targetChar, activeChar);
  }
View Full Code Here

  private boolean cmd_Show(Quest _quest, String[] wordList, L2Player activeChar)
  {
    // quest id|name SHOW [target]
    L2Player targetChar = getTargetChar(wordList, 3, activeChar);
    QuestState qs = targetChar.getQuestState(_quest.getName());
    if(qs == null)
    {
      activeChar.sendMessage("Player " + targetChar.getName() + " havn't Quest [" + _quest.getName() + "]");
      return false;
    }
View Full Code Here

    if(_quest == null)
    {
      activeChar.sendMessage("Quest " + var[1] + " undefined");
      return;
    }
    QuestState qs = targetChar.getQuestState(_quest.getName());
    if(qs == null)
    {
      activeChar.sendMessage("Player " + targetChar.getName() + " havn't Quest [" + _quest.getName() + "]");
    }
    ShowQuestState(qs, activeChar);
View Full Code Here

    {
      activeChar.sendMessage("USAGE: //quest id|name VAR varname newvalue [target]");
      return false;
    }
    L2Player targetChar = getTargetChar(wordList, 5, activeChar);
    QuestState qs = targetChar.getQuestState(_quest.getName());
    if(qs == null)
    {
      activeChar.sendMessage("Player " + targetChar.getName() + " havn't Quest [" + _quest.getName() + "], init quest by command:");
      activeChar.sendMessage("//quest id|name STATE 1|2|3 [target]");
      return false;
    }
    if(wordList[4].equalsIgnoreCase("~") || wordList[4].equalsIgnoreCase("#"))
    {
      qs.unset(wordList[3]);
    }
    else
    {
      qs.set(wordList[3], wordList[4]);
    }
    return ShowQuestState(qs, activeChar);
  }
View Full Code Here

    {
      activeChar.sendMessage("Wrong State ID: " + wordList[3]);
      return false;
    }
    L2Player targetChar = getTargetChar(wordList, 4, activeChar);
    QuestState qs = targetChar.getQuestState(_quest.getName());
    if(qs == null)
    {
      activeChar.sendMessage("Init Quest [" + _quest.getName() + "] for " + targetChar.getName());
      qs = _quest.newQuestState(targetChar, state);
      qs.set("cond", "1");
    }
    else
    {
      qs.setState(state);
    }
    return ShowQuestState(qs, activeChar);
  }
View Full Code Here

  }

  @Override
  public String onFirstTalk(L2NpcInstance npc, L2Player player)
  {
    QuestState qs = player.getQuestState(_184_NikolasCooperationContract.class);
    if(qs != null && qs.isCompleted() && player.getQuestState(getClass()) == null)
    {
      newQuestState(player, STARTED);
    }
    return "";
  }
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.