Package l2p.gameserver.model.quest

Examples of l2p.gameserver.model.quest.QuestTimer


    else if(npcId == AldersSpirit)
    {
      htmltext = "30613-02.htm";
      st.set("cond", "11");
      st.setState(STARTED);
      QuestTimer timer = st.getQuestTimer("AldersSpirit_Fail");
      if(timer != null)
      {
        timer.cancel();
      }
      L2NpcInstance isQuest = L2ObjectsStorage.getByNpcId(AldersSpirit);
      if(isQuest != null)
      {
        isQuest.deleteMe();
View Full Code Here


        if(st.getQuestItemsCount(5588) == 0)
        {
          st.giveItems(5588, 1);
        }
        st.set("Ex", "-3");
        QuestTimer timer = st.getQuestTimer("QT");
        if(timer != null)
        {
          timer.cancel();
        }
        st.startQuestTimer("QT", 30000);
      }
      else if(Ex == -3)
      {
        st.playTutorialVoice("tutorial_voice_002");
        st.set("Ex", "0");
      }
      else if(Ex == -4)
      {
        st.playTutorialVoice("tutorial_voice_008");
        st.set("Ex", "-5");
      }
    }
    // Tutorial close
    else if(event.startsWith("TE"))
    {
      QuestTimer timer = st.getQuestTimer("TE");
      if(timer != null)
      {
        timer.cancel();
      }
      int event_id = 0;
      if(!event.equalsIgnoreCase("TE"))
      {
        event_id = Integer.valueOf(event.substring(2));
View Full Code Here

      }
      qs.takeItems(LIDIA_HAIR_PIN, -1);
    }
    else if(npcId == MYSTERIOUS_WIZARD)
    {
      QuestTimer timer_speak = qs.getQuestTimer("To talk with Mystik");
      if(cond == 10 && qs.getQuestItemsCount(SUSPICIOUS_TOTEM_DOLL) != 0)
      {
        htmltext = "31522-01.htm";
      }
      else if(cond == 11 && timer_speak == null && qs.getQuestItemsCount(SUSPICIOUS_TOTEM_DOLL1) == 0)
View Full Code Here

      st.setState(STARTED);
    }
    else if(event.equals("Wait1"))
    {
      Despawn_OlMahumSupportTroop();
      QuestTimer timer = st.getQuestTimer("Wait1");
      if(timer != null)
      {
        timer.cancel();
      }
      return null;
    }
    return htmltext;
  }
View Full Code Here

  {
    if(L2ObjectsStorage.getNpc(st2.getInt("Archon")) != null)
    {
      return;
    } // Не убили, или убили чужого
    QuestTimer qt = st2.getQuestTimer("Archon Hellisha has despawned");
    if(qt != null)
    {
      qt.cancel();
    }
    if(st2.getQuestItemsCount(Items[3]) < 700)
    {
      st2.giveItems(Items[3], 1);
    }
View Full Code Here

      L2NpcInstance Mob_2 = FindMySpawn(player, NPC[4]);
      if(Mob_2 != null)
      {
        AutoChat(Mob_2, Text[13].replace("PLAYERNAME", player.getName()));
        DeleteMySpawn(player, NPC[4]);
        QuestTimer qt = st.getQuestTimer("Mob_2 has despawned");
        if(qt != null)
        {
          qt.cancel();
        }
        qt = st.getQuestTimer("NPC_4 Timer");
        if(qt != null)
        {
          qt.cancel();
        }
      }
      return null;
    }
    else if(event.equalsIgnoreCase("5-1"))
    {
      st.set("cond", "6");
      st.takeItems(Items[4], 1);
      Cast(st.findTemplate(NPC[5]), player, 4546, 1);
      st.playSound(SOUND_MIDDLE);
      htmltext = "5-02.htm";
    }
    else if(event.equalsIgnoreCase("6-1"))
    {
      st.set("cond", "8");
      st.takeItems(Items[5], 1);
      Cast(st.findTemplate(NPC[6]), player, 4546, 1);
      st.playSound(SOUND_MIDDLE);
      htmltext = "6-03.htm";
    }
    else if(event.equalsIgnoreCase("7-1"))
    {
      if(FindMySpawn(player, Mob[0]) == null)
      {
        L2NpcInstance Mob_1 = spawn(Mob[0], new Location(X[0], Y[0], Z[0]));
        AddSpawn(player, Mob_1, 180000);
        startQuestTimer("Mob_0 Timer", 500L, Mob_1, player);
        startQuestTimer("Mob_1 has despawned", 120000L, Mob_1, player);
        htmltext = "7-02.htm";
      }
      else
      {
        htmltext = "7-03.htm";
      }
    }
    else if(event.equalsIgnoreCase("7-2"))
    {
      st.set("cond", "10");
      st.takeItems(Items[6], 1);
      Cast(st.findTemplate(NPC[7]), player, 4546, 1);
      st.playSound(SOUND_MIDDLE);
      htmltext = "7-06.htm";
    }
    else if(event.equalsIgnoreCase("8-1"))
    {
      st.set("cond", "14");
      st.takeItems(Items[7], 1);
      Cast(st.findTemplate(NPC[8]), player, 4546, 1);
      st.playSound(SOUND_MIDDLE);
      htmltext = "8-02.htm";
    }
    else if(event.equalsIgnoreCase("9-1"))
    {
      st.set("cond", "17");
      st.takeItems(Items[8], 1);
      Cast(st.findTemplate(NPC[9]), player, 4546, 1);
      st.playSound(SOUND_MIDDLE);
      htmltext = "9-03.htm";
    }
    else if(event.equalsIgnoreCase("10-1"))
    {
      if(st.getInt("Quest0") == 0 || FindMySpawn(player, NPC[4]) == null)
      {
        DeleteMySpawn(player, NPC[4]);
        DeleteMySpawn(player, Mob[2]);
        st.set("Quest0", "1");
        st.set("Quest1", "45");
        L2NpcInstance NPC_4 = spawn(NPC[4], new Location(X[2], Y[2], Z[2]));
        L2NpcInstance Mob_2 = spawn(Mob[2], new Location(X[1], Y[1], Z[1]));
        AddSpawn(player, Mob_2, 300000);
        AddSpawn(player, NPC_4, 300000);
        startQuestTimer("Mob_2 Timer", 1000, Mob_2, player);
        startQuestTimer("Mob_2 despawn", 59000, Mob_2, player);
        startQuestTimer("NPC_4 Timer", 500, NPC_4, player);
        startQuestTimer("NPC_4 despawn", 60000, NPC_4, player);
        htmltext = "10-02.htm";
      }
      else if(st.getInt("Quest1") == 45)
      {
        htmltext = "10-03.htm";
      }
      else if(st.getInt("Tab") == 1)
      {
        L2NpcInstance Mob_2 = FindMySpawn(player, NPC[4]);
        if(Mob_2 == null || !st.getPlayer().knowsObject(Mob_2))
        {
          DeleteMySpawn(player, NPC[4]);
          Mob_2 = spawn(NPC[4], new Location(X[2], Y[2], Z[2]));
          AddSpawn(player, Mob_2, 300000);
          st.set("Quest0", "1");
          st.set("Quest1", "0"); // На всякий случай
          QuestTimer qt = st.getQuestTimer("NPC_4 despawn");
          if(qt != null)
          {
            qt.cancel();
          }
          startQuestTimer("NPC_4 despawn", 180000, Mob_2, player);
        }
        htmltext = "10-04.htm";
      }
View Full Code Here

          {
            st.set("Quest0", "1");
            AutoChat(npc, Text[17].replace("PLAYERNAME", player.getName()));
            npc.reduceCurrentHp(9999999, npc, null, true, true, false, false);
            DeleteMySpawn(player, Mob[2]);
            QuestTimer qt = st.getQuestTimer("Mob_2 despawn");
            if(qt != null)
            {
              qt.cancel();
            }
            st.set("Tab", "1");
          }
        }
      }
View Full Code Here

              st.giveItems(Items[6], 1);
              st.set("cond", "9");
              st.playSound(SOUND_MIDDLE);
            }
          }
          QuestTimer qt = st.getQuestTimer("Mob_1 has despawned");
          if(qt != null)
          {
            qt.cancel();
          }
          DeleteMySpawn(st2.getPlayer(), Mob[0]);
        }
      }
      else if(npcId == Mob[1] && cond == 15)
      {
        QuestState st2 = findRightState(player, npc);
        if(st2 != null)
        {
          if(!player.isInParty())
          {
            if(st == st2)
            {
              AutoChat(npc, Text[4].replace("PLAYERNAME", player.getName()));
              process_step_15to16(st);
            }
            else
            {
              AutoChat(npc, Text[5].replace("PLAYERNAME", player.getName()));
            }
          }
          QuestTimer qt = st.getQuestTimer("Archon Hellisha has despawned");
          if(qt != null)
          {
            qt.cancel();
          }
          DeleteMySpawn(st2.getPlayer(), Mob[1]);
        }
      }
      else if(npcId == Mob[2] && cond == 17)
      {
        QuestState st2 = findRightState(player, npc);
        if(st == st2)
        {
          st.set("Quest0", "1");
          AutoChat(npc, Text[17].replace("PLAYERNAME", player.getName()));
          npc.reduceCurrentHp(9999999, npc, null, true, true, false, false);
          DeleteMySpawn(player, Mob[2]);
          QuestTimer qt = st.getQuestTimer("Mob_2 despawn");
          if(qt != null)
          {
            qt.cancel();
          }
          st.set("Tab", "1");
        }
      }
    }
View Full Code Here

        st.set("cond", "17");
        st.setState(STARTED);
      }
      else
      {
        QuestTimer timer = st.getQuestTimer("Wait1");
        if(timer == null)
        {
          st.startQuestTimer("Wait1", 300000);
        }
        htmltext = "<html><head><body>Plees wait 5 minutes</body></html>";
      }
    }
    else if(event.equalsIgnoreCase("30628-01a.htm"))
    {
      st.takeItems(RustedKey, -1);
      st.giveItems(GoldBar, 20);
      st.set("cond", "18");
    }
    else if(event.equalsIgnoreCase("Wait1") || event.equalsIgnoreCase("Chest"))
    {
      L2NpcInstance isQuest = L2ObjectsStorage.getByNpcId(Chest);
      if(isQuest != null)
      {
        isQuest.deleteMe();
      }
      QuestTimer timer = st.getQuestTimer("Wait1");
      if(timer != null)
      {
        timer.cancel();
      }
      timer = st.getQuestTimer("Chest");
      if(timer != null)
      {
        timer.cancel();
      }
      if(st.getInt("cond") == 17)
      {
        st.set("cond", "16");
      }
View Full Code Here

            st.takeItems(HERB_OF_VANOR, 1);
            st.takeItems(HERB_OF_OEL_MAHUM, 1);
            st.takeItems(BLOOD_OF_EVA, 1);
            st.giveItems(POTION_OF_RECOVERY, 1);
            st.giveItems(VOUCHER_OF_FAITH, 1);
            QuestTimer timer = leader.getQuestTimer("poison_timer");
            if(timer != null)
            {
              timer.cancel();
            }
            removeQuestFromMembers(st, false);
            st.getPlayer().setImobilised(false);
            st.getPlayer().getEffectList().stopEffect(4082);
            st.set("cond", "4");
            st.playSound(SOUND_FINISH);
            return "30759-08.htm";
          }
          else if(st.getQuestItemsCount(VOUCHER_OF_FAITH) == 0)
          {
            return "30759-10.htm";
          }
        }
      }
      else if(leader.getInt("cond") == 3)
      {
        return "30759-11.htm";
      }
    }
    else if(npcId == STATUE_OF_OFFERING)
    {
      if(st.getPlayer().isClanLeader())
      {
        return "30757-03.htm";
      }
      else if(st.getPlayer().getLevel() <= 39)
      {
        st.exitCurrentQuest(true);
        return "30757-02.htm";
      }
      else
      {
        String[] dlist;
        int deads;
        try
        {
          dlist = leader.get("dead_list").split(" ");
          deads = dlist.length;
        }
        catch(Exception e)
        {
          removeQuestFromMembers(st, true);
          return "Who are you?";
        }
        if(deads < 3)
        {
          for(String str : dlist)
          {
            if(st.getPlayer().getName().equalsIgnoreCase(str))
            {
              return "you cannot die again!";
            }
          }
          return "30757-01.htm";
        }
      }
    }
    else if(npcId == WITCH_ATHREA)
    {
      if(st.getPlayer().isClanLeader())
      {
        return "30757-03.htm";
      }
      // Проверяем, участвует ли в квесте
      String[] dlist;
      try
      {
        dlist = leader.get("dead_list").split(" ");
      }
      catch(Exception e)
      {
        st.exitCurrentQuest(true);
        return "Who are you?";
      }
      Boolean flag = false;
      if(dlist != null)
      {
        for(String str : dlist)
        {
          if(st.getPlayer().getName().equalsIgnoreCase(str))
          {
            flag = true;
          }
        }
      }
      if(!flag)
      {
        st.exitCurrentQuest(true);
        return "Who are you?";
      }
      int game_state = leader.getInt("chest_game");
      if(game_state == 0)
      {
        if(leader.getInt("chest_try") == 0)
        {
          return "30758-01.htm";
        }
        return "30758-05.htm";
      }
      else if(game_state == 1)
      {
        return "30758-09.htm";
      }
      else if(game_state == 2)
      {
        st.playSound(SOUND_FINISH);
        st.giveItems(BLOOD_OF_EVA, 1);
        QuestTimer timer = leader.getQuestTimer("chest_timer");
        if(timer != null)
        {
          timer.cancel();
        }
        stop_chest_game(st);
        leader.set("chest_game", "3");
        return "30758-08.htm";
      }
View Full Code Here

TOP

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

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.