Examples of Quest


Examples of com.aldaviva.autorpg.data.entities.Quest

  private CharacterItemManager characterItemManager;
 
  @Transactional
  public Quest start(){
    try {
      Quest quest = Quest.findRandomByInactive();
   
      List<Character> characters = Character.findRandomByOnline(Quest.CHARACTERS_PER_QUEST);
      quest.setCharacters(new HashSet<Character>(characters));
      for(Character character : quest.getCharacters()){
        character.setQuest(quest);
      }
      quest.setExpRemaining(quest.getExpTotal());
      quest.setStep(1);
      stepReached(quest);
     
      bulletinManager.publish(stepReached(quest));
     
      quest.merge();
     
      return quest;
    } catch (NotEnoughPlayersError e) {
      return null;
    } catch (EmptyResultDataAccessException e){
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.quest.Quest

  {
    L2PcInstance activeChar = getClient().getActiveChar();
    if(activeChar == null)
      return;

    Quest qe = null;
    if(!Config.ALT_DEV_NO_QUESTS)
      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();
        activeChar.sendPacket(ql);
      }
      else
      {
        if(Config.DEBUG)
        {
          _log.info("Player '" + activeChar.getName() + "' try to abort quest " + qe.getName() + " but he didn't have it started.");
        }
      }
    }
    else
    {
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.quest.Quest

  }

  public void startTutorialQuest(L2PcInstance player)
  {
    QuestState qs = player.getQuestState("255_Tutorial");
    Quest q = null;

    if(qs == null && !Config.ALT_DEV_NO_QUESTS){
      q = QuestManager.getInstance().getQuest("255_Tutorial");
    }
   
    if(q != null)
      q.newQuestState(player);
  }
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.quest.Quest

   */
  public void showQuestWindow(L2PcInstance player, String questId)
  {
    String content = null;
   
    Quest q = null;
    if (!Config.ALT_DEV_NO_QUESTS)
      q = QuestManager.getInstance().getQuest(questId);
   
    // Get the state of the selected quest
    QuestState qs = player.getQuestState(questId);
   
    if (q == null)
    {
      // No quests found
      content = "<html><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>";
    }
    else
    {
      if (player.getWeightPenalty() >= 3 && q.getQuestIntId() >= 1 && q.getQuestIntId() < 1000)
      {
        player.sendPacket(new SystemMessage(SystemMessageId.INVENTORY_LESS_THAN_80_PERCENT));
        return;
      }
     
      if (qs == null)
      {
        if (q.getQuestIntId() >= 1 && q.getQuestIntId() < 20000)
        {
          Quest[] questList = player.getAllActiveQuests();
          if (questList.length >= 25) // if too many ongoing quests, don't show window and send message
          {
            player.sendMessage("You have too many quests, cannot register");
            return;
          }
        }
        // Check for start point
        for (Quest temp : getTemplate().getEventQuests(Quest.QuestEventType.QUEST_START))
        {
          if (temp == q)
          {
            qs = q.newQuestState(player);
            break;
          }
        }
      }
    }
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.quest.Quest

    _log.info("Initializing QuestManager");
  }

  public final boolean reload(String questFolder)
  {
    Quest q = getQuest(questFolder);
    if(q == null)
      return false;
    return q.reload();
  }
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.quest.Quest

   * @param questId The id of the quest to be reloaded
   * @return true if reload was succesful, false otherwise
   */
  public final boolean reload(int questId)
  {
    Quest q = this.getQuest(questId);
    if(q == null)
      return false;
    return q.reload();
  }
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.quest.Quest

    if(qs == null && event.length() == 0)
      return retval;

    if(qs == null)
    {
      Quest q = null;
      if(!Config.ALT_DEV_NO_QUESTS)
        q = QuestManager.getInstance().getQuest(quest);
     
      if(q == null)
        return retval;
      qs = q.newQuestState(this);
    }
    if(qs != null)
    {
      if(getLastQuestNpcObject() > 0)
      {
View Full Code Here

Examples of l2p.gameserver.model.quest.Quest

      }
      else
      {
        player.sendPacket(Msg.CONGRATULATIONS_YOUR_RAID_WAS_SUCCESSFUL);
      }
      Quest q = QuestManager.getQuest(508);
      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);
        }
View Full Code Here

Examples of l2p.gameserver.model.quest.Quest

  }

  @Override
  protected boolean thinkActive()
  {
    Quest q = QuestManager.getQuest(24);
    if(q != null)
    {
      for(L2Player player : L2World.getAroundPlayers(getActor(), 900, 200))
      {
        player.processQuestEvent(q.getName(), myEvent, null);
      }
    }
    return super.thinkActive();
  }
View Full Code Here

Examples of l2p.gameserver.model.quest.Quest

    L2Player player = (L2Player) getSelf();
    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
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.