Package l2p.gameserver.model.quest

Examples of l2p.gameserver.model.quest.QuestTimer$ScheduleTimerTask


      removeQuestFromMembers(st, true);
      return "Quest Failed";
    }
    // first part, general checking
    int npcId = npc.getNpcId();
    QuestTimer timer = leader.getQuestTimer("poison_timer");
    if(timer == null)
    {
      stop_chest_game(st);
      return "Quest Failed";
    }
    // second part, herbs gathering
    for(int[] m : MOBS)
    {
      if(npcId == m[0] && st.getInt(String.valueOf(m[1])) == 0)
      {
        if(Rnd.chance(RATE))
        {
          st.giveItems(m[1], 1);
          leader.set(String.valueOf(m[1]), "1");
          st.playSound(SOUND_MIDDLE);
          return null;
        }
      }
    }
    // third part, chest game
    for(int i : CHESTS)
    {
      if(npcId == i)
      {
        timer = leader.getQuestTimer("chest_timer");
        if(timer == null)
        {
          stop_chest_game(st);
          return "Time is up!";
        }
        if(Rnd.chance(25))
        {
          Functions.npcSay(npc, "###### BINGO! ######");
          int count = leader.getInt("chest_count");
          if(count < 4)
          {
            count += 1;
            leader.set("chest_count", String.valueOf(count));
          }
          if(count >= 4)
          {
            stop_chest_game(st);
            leader.set("chest_game", "2");
            timer.cancel();
            st.playSound(SOUND_MIDDLE);
          }
          else
          {
            st.playSound(SOUND_ITEMGET);
View Full Code Here


      removeQuestFromMembers(st, true);
      return null;
    }
    if(st.getPlayer() == pc)
    {
      QuestTimer timer1 = leader.getQuestTimer("poison_timer");
      QuestTimer timer2 = leader.getQuestTimer("chest_timer");
      if(timer1 != null)
      {
        timer1.cancel();
      }
      if(timer2 != null)
      {
        timer2.cancel();
      }
      removeQuestFromMembers(st, true);
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.quest.QuestTimer$ScheduleTimerTask

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.