Package l2p.gameserver.model.instances

Examples of l2p.gameserver.model.instances.L2NpcInstance


    }
    else if(event.equalsIgnoreCase("30615-04.htm"))
    {
      //Проверяем есть ли в мире уже квест монстры
      int spawn = 0;
      L2NpcInstance isQuest = L2ObjectsStorage.getByNpcId(PashikasSonOfVoltarQuestMonster);
      if(isQuest != null)
      {
        spawn = 1;
      }
      isQuest = L2ObjectsStorage.getByNpcId(VultusSonOfVoltarQuestMonster);
      if(isQuest != null)
      {
        spawn = 1;
      }
      if(spawn == 1) //если хоть один моб есть в мире, ставим таймер на удаление их(ня всякий) + говорим игроку подождать.
      {
        QuestTimer timer = st.getQuestTimer("Wait1");
        if(timer == null)
        {
          st.startQuestTimer("Wait1", 300000);
        }
        htmltext = "<html><head><body>Plees wait 5 minutes</body></html>";
      }
      else
      {
        st.takeItems(ManakiaLetter1st, -1);
        st.giveItems(GloveOfVoltar, 1);
        QuestTimer timer = st.getQuestTimer("Wait1");
        if(timer != null)
        {
          timer.cancel();
        }
        st.startQuestTimer("PashikasSonOfVoltarQuestMonster", 200000);
        st.startQuestTimer("VultusSonOfVoltarQuestMonster", 200000);
        st.addSpawn(PashikasSonOfVoltarQuestMonster);
        st.addSpawn(VultusSonOfVoltarQuestMonster);
        st.playSound(SOUND_BEFORE_BATTLE);
      }
    }
    else if(event.equalsIgnoreCase("30616-04.htm"))
    {
      //Проверяем есть ли в мире уже квест монстры
      L2NpcInstance isQuest = L2ObjectsStorage.getByNpcId(EnkuOrcOverlordQuestMonster);
      if(isQuest != null)
      {
        QuestTimer timer = st.getQuestTimer("Wait2");
        if(timer == null)
        {
          st.startQuestTimer("Wait2", 300000);
        }
        htmltext = "<html><head><body>Plees wait 5 minutes</body></html>";
      }
      else
      {
        st.takeItems(ManakiaLetter2st, -1);
        st.giveItems(GloveOfKepra, 1);
        QuestTimer timer = st.getQuestTimer("Wait2");
        if(timer != null)
        {
          timer.cancel();
        }
        st.startQuestTimer("EnkuOrcOverlordQuestMonster", 200000);
        st.addSpawn(EnkuOrcOverlordQuestMonster);
        st.addSpawn(EnkuOrcOverlordQuestMonster);
        st.addSpawn(EnkuOrcOverlordQuestMonster);
        st.addSpawn(EnkuOrcOverlordQuestMonster);
        st.playSound(SOUND_BEFORE_BATTLE);
      }
    }
    else if(event.equalsIgnoreCase("30617-04.htm"))
    {
      //Проверяем есть ли в мире уже квест монстры
      L2NpcInstance isQuest = L2ObjectsStorage.getByNpcId(MakumBugbearThugQuestMonster);
      if(isQuest != null)
      {
        QuestTimer timer = st.getQuestTimer("Wait3");
        if(timer == null)
        {
          st.startQuestTimer("Wait3", 300000);
        }
        htmltext = "<html><head><body>Plees wait 5 minutes</body></html>";
      }
      else
      {
        st.takeItems(KasmansLetter2rd, -1);
        st.giveItems(GloveOfBurai, 1);
        QuestTimer timer = st.getQuestTimer("Wait3");
        if(timer != null)
        {
          timer.cancel();
        }
        st.startQuestTimer("MakumBugbearThugQuestMonster", 200000);
        st.addSpawn(MakumBugbearThugQuestMonster);
        st.addSpawn(MakumBugbearThugQuestMonster);
        st.playSound(SOUND_BEFORE_BATTLE);
      }
    }
    else if(event.equalsIgnoreCase("30618-03.htm"))
    {
      st.takeItems(KasmansLetter3rd, -1);
      st.giveItems(ScepterOfTunath, 1);
      if(st.getQuestItemsCount(ScepterOfBreka) != 0 && st.getQuestItemsCount(ScepterOfEnku) != 0 && st.getQuestItemsCount(ScepterOfVuku) != 0 && st.getQuestItemsCount(ScepterOfTurek) != 0 && st.getQuestItemsCount(ScepterOfTunath) != 0)
      {
        st.set("cond", "5");
        st.setState(STARTED);
      }
    }
    else if(event.equalsIgnoreCase("30619-03.htm"))
    {
      st.takeItems(KasmansLetter1rd, -1);
      st.giveItems(DrikosContract, 1);
    }
    //Далее идет 3 велосипеда
    else if(event.equalsIgnoreCase("Wait1") || event.equalsIgnoreCase("PashikasSonOfVoltarQuestMonster") || event.equalsIgnoreCase("VultusSonOfVoltarQuestMonster"))
    {
      L2NpcInstance isQuest = L2ObjectsStorage.getByNpcId(PashikasSonOfVoltarQuestMonster);
      if(isQuest != null)
      {
        isQuest.deleteMe();
      }
      isQuest = L2ObjectsStorage.getByNpcId(VultusSonOfVoltarQuestMonster);
      if(isQuest != null)
      {
        isQuest.deleteMe();
      }
      QuestTimer timer = st.getQuestTimer("Wait1");
      if(timer != null)
      {
        timer.cancel();
      }
      timer = st.getQuestTimer("PashikasSonOfVoltarQuestMonster");
      if(timer != null)
      {
        timer.cancel();
      }
    }
    else if(event.equalsIgnoreCase("Wait2") || event.equalsIgnoreCase("EnkuOrcOverlordQuestMonster"))
    {
      //Велосипед, но нужно удалить всех 4 одинаковых мобов
      L2NpcInstance isQuest = L2ObjectsStorage.getByNpcId(EnkuOrcOverlordQuestMonster);
      if(isQuest != null)
      {
        isQuest.deleteMe();
      }
      isQuest = L2ObjectsStorage.getByNpcId(EnkuOrcOverlordQuestMonster);
      if(isQuest != null)
      {
        isQuest.deleteMe();
      }
      isQuest = L2ObjectsStorage.getByNpcId(EnkuOrcOverlordQuestMonster);
      if(isQuest != null)
      {
        isQuest.deleteMe();
      }
      isQuest = L2ObjectsStorage.getByNpcId(EnkuOrcOverlordQuestMonster);
      if(isQuest != null)
      {
        isQuest.deleteMe();
      }
      QuestTimer timer = st.getQuestTimer("Wait2");
      if(timer != null)
      {
        timer.cancel();
      }
      timer = st.getQuestTimer("EnkuOrcOverlordQuestMonster");
      if(timer != null)
      {
        timer.cancel();
      }
    }
    else if(event.equalsIgnoreCase("Wait3") || event.equalsIgnoreCase("MakumBugbearThugQuestMonster"))
    {
      //Велосипед, но нужно удалить всех 2 одинаковых мобов
      L2NpcInstance isQuest = L2ObjectsStorage.getByNpcId(MakumBugbearThugQuestMonster);
      if(isQuest != null)
      {
        isQuest.deleteMe();
      }
      isQuest = L2ObjectsStorage.getByNpcId(MakumBugbearThugQuestMonster);
      if(isQuest != null)
      {
        isQuest.deleteMe();
      }
      QuestTimer timer = st.getQuestTimer("Wait3");
      if(timer != null)
      {
        timer.cancel();
      }
      timer = st.getQuestTimer("MakumBugbearThugQuestMonster");
      if(timer != null)
      {
        timer.cancel();
      }
    }
    else if(event.equalsIgnoreCase("Wait4") || event.equalsIgnoreCase("RevenantOfTantosChief"))
    {
      //Тележка...
      L2NpcInstance isQuest = L2ObjectsStorage.getByNpcId(RevenantOfTantosChief);
      if(isQuest != null)
      {
        isQuest.deleteMe();
      }
      QuestTimer timer = st.getQuestTimer("Wait4");
      if(timer != null)
      {
        timer.cancel();
View Full Code Here


        }
        else if(st.getQuestItemsCount(GloveOfVoltar) > 0 && (st.getQuestItemsCount(PashikasHead) == 0 || st.getQuestItemsCount(VultusHead) == 0))
        {
          htmltext = "30615-05.htm";
          int sound = 0;
          L2NpcInstance isQuest = L2ObjectsStorage.getByNpcId(PashikasSonOfVoltarQuestMonster);
          if(isQuest == null)
          {
            sound = 1;
            st.addSpawn(PashikasSonOfVoltarQuestMonster);
            st.startQuestTimer("PashikasSonOfVoltarQuestMonster", 200000);
          }
          isQuest = L2ObjectsStorage.getByNpcId(VultusSonOfVoltarQuestMonster);
          if(isQuest == null)
          {
            sound = 1;
            st.addSpawn(VultusSonOfVoltarQuestMonster);
            st.startQuestTimer("VultusSonOfVoltarQuestMonster", 200000);
          }
          if(sound == 1)
          {
            st.playSound(SOUND_BEFORE_BATTLE);
            QuestTimer timer = st.getQuestTimer("Wait1");
            if(timer != null)
            {
              timer.cancel();
            }
          }
          else
          {
            st.startQuestTimer("Wait1", 300000);
            htmltext = "<html><head><body>Plees wait 5 minutes</body></html>";
          }
        }
        else if(st.getQuestItemsCount(PashikasHead) > 0 && st.getQuestItemsCount(VultusHead) > 0)
        {
          st.takeItems(PashikasHead, -1);
          st.takeItems(VultusHead, -1);
          st.takeItems(GloveOfVoltar, -1);
          st.giveItems(ScepterOfBreka, 1);
          htmltext = "30615-06.htm";
          if(st.getQuestItemsCount(ScepterOfBreka) > 0 && st.getQuestItemsCount(ScepterOfEnku) > 0 && st.getQuestItemsCount(ScepterOfVuku) > 0 && st.getQuestItemsCount(ScepterOfTurek) > 0 && st.getQuestItemsCount(ScepterOfTunath) > 0)
          {
            st.set("cond", "5");
            st.setState(STARTED);
            st.playSound(SOUND_MIDDLE);
          }
          else
          {
            st.playSound(SOUND_ITEMGET);
          }
        }
        else if(st.getQuestItemsCount(ScepterOfBreka) > 0)
        {
          htmltext = "30615-07.htm";
        }
        else
        {
          htmltext = "30615-01.htm";
        }
      }
    }
    else if(npcId == Kepra)
    {
      if(cond == 4)
      {
        if(st.getQuestItemsCount(ManakiaLetter2st) > 0)
        {
          htmltext = "30616-02.htm";
        }
        else if(st.getQuestItemsCount(GloveOfKepra) > 0 && st.getQuestItemsCount(EnkuOverlordHead) < 4)
        {
          htmltext = "30616-05.htm";
          L2NpcInstance isQuest = L2ObjectsStorage.getByNpcId(EnkuOrcOverlordQuestMonster);
          if(isQuest != null)
          {
            st.startQuestTimer("Wait2", 300000);
            htmltext = "<html><head><body>Plees wait 5 minutes</body></html>";
          }
          else
          {
            QuestTimer timer = st.getQuestTimer("Wait2");
            if(timer != null)
            {
              timer.cancel();
            }
            st.startQuestTimer("EnkuOrcOverlordQuestMonster", 200000);
            st.addSpawn(EnkuOrcOverlordQuestMonster);
            st.addSpawn(EnkuOrcOverlordQuestMonster);
            st.addSpawn(EnkuOrcOverlordQuestMonster);
            st.addSpawn(EnkuOrcOverlordQuestMonster);
            st.playSound(SOUND_BEFORE_BATTLE);
          }
        }
        else if(st.getQuestItemsCount(EnkuOverlordHead) >= 4)
        {
          htmltext = "30616-06.htm";
          st.takeItems(EnkuOverlordHead, -1);
          st.takeItems(GloveOfKepra, -1);
          st.giveItems(ScepterOfEnku, 1);
          if(st.getQuestItemsCount(ScepterOfBreka) > 0 && st.getQuestItemsCount(ScepterOfEnku) > 0 && st.getQuestItemsCount(ScepterOfVuku) > 0 && st.getQuestItemsCount(ScepterOfTurek) > 0 && st.getQuestItemsCount(ScepterOfTunath) > 0)
          {
            st.set("cond", "5");
            st.setState(STARTED);
            st.playSound(SOUND_MIDDLE);
          }
          else
          {
            st.playSound(SOUND_ITEMGET);
          }
        }
        else if(st.getQuestItemsCount(ScepterOfEnku) > 0)
        {
          htmltext = "30616-07.htm";
        }
        else
        {
          htmltext = "30616-01.htm";
        }
      }
    }
    else if(npcId == Burai)
    {
      if(cond == 4)
      {
        if(st.getQuestItemsCount(KasmansLetter2rd) > 0)
        {
          htmltext = "30617-02.htm";
        }
        else if(st.getQuestItemsCount(GloveOfBurai) > 0 && st.getQuestItemsCount(MakumBugbearHead) < 2)
        {
          htmltext = "30617-05.htm";
          L2NpcInstance isQuest = L2ObjectsStorage.getByNpcId(MakumBugbearThugQuestMonster);
          if(isQuest != null)
          {
            st.startQuestTimer("Wait3", 300000);
            htmltext = "<html><head><body>Plees wait 5 minutes</body></html>";
          }
View Full Code Here

        QuestTimer timer = st.getQuestTimer("PashikasSonOfVoltarQuestMonster");
        if(timer != null)
        {
          timer.cancel();
        }
        L2NpcInstance isQuest = L2ObjectsStorage.getByNpcId(PashikasSonOfVoltarQuestMonster);
        if(isQuest != null)
        {
          isQuest.deleteMe();
        }
        if(st.getQuestItemsCount(GloveOfVoltar) > 0 && st.getQuestItemsCount(PashikasHead) == 0)
        {
          st.giveItems(PashikasHead, 1);
        }
      }
      else if(npcId == VultusSonOfVoltarQuestMonster)
      {
        QuestTimer timer = st.getQuestTimer("VultusSonOfVoltarQuestMonster");
        if(timer != null)
        {
          timer.cancel();
        }
        L2NpcInstance isQuest = L2ObjectsStorage.getByNpcId(VultusSonOfVoltarQuestMonster);
        if(isQuest != null)
        {
          isQuest.deleteMe();
        }
        if(st.getQuestItemsCount(GloveOfVoltar) > 0 && st.getQuestItemsCount(VultusHead) == 0)
        {
          st.giveItems(VultusHead, 1);
        }
      }
    }
    else if(cond == 6 && st.getQuestItemsCount(TimakOrcHead) >= 20 && st.getQuestItemsCount(TamlinOrcSkull) >= 20)
    {
      st.set("cond", "7");
      st.setState(STARTED);
    }
    else if(cond == 9)
    {
      if(npcId == RagnaOrcOverlord || npcId == RagnaOrcSeer)
      {
        L2NpcInstance isQuest = L2ObjectsStorage.getByNpcId(RevenantOfTantosChief);
        if(isQuest == null)
        {
          st.startQuestTimer("RevenantOfTantosChief", 300000);
          st.addSpawn(RevenantOfTantosChief);
          st.playSound(SOUND_BEFORE_BATTLE);
        }
        else
        {
          QuestTimer timer = st.getQuestTimer("Wait4");
          if(timer == null)
          {
            st.startQuestTimer("Wait4", 300000);
          }
        }
      }
      else if(npcId == RevenantOfTantosChief)
      {
        QuestTimer timer = st.getQuestTimer("RevenantOfTantosChief");
        if(timer != null)
        {
          timer.cancel();
        }
        timer = st.getQuestTimer("Wait4");
        if(timer != null)
        {
          timer.cancel();
        }
        L2NpcInstance isQuest = L2ObjectsStorage.getByNpcId(RevenantOfTantosChief);
        if(isQuest != null)
        {
          isQuest.deleteMe();
        }
        st.giveItems(ScepterOfTantos, 1);
        st.set("cond", "10");
        st.setState(STARTED);
        st.playSound(SOUND_MIDDLE);
View Full Code Here

          L2Player pl = (L2Player) this;
          for(L2Character target : targets)
          {
            if(target != null && target.isNpc())
            {
              L2NpcInstance npc = (L2NpcInstance) target;
              GArray<QuestState> ql = pl.getQuestsForEvent(npc, QuestEventType.MOB_TARGETED_BY_SKILL);
              if(ql != null)
              {
                for(QuestState qs : ql)
                {
View Full Code Here

  }
 
  @Override
  protected boolean maybeMoveToHome()
  {
    L2NpcInstance actor = getActor();
    Location loc = actor.getSpawnedLoc();
    if (actor.isInRange(loc, 10000))
    {
      return true;
    }
    return true;
  }
View Full Code Here

  }
 
  @Override
  protected void onEvtAttacked(L2Character attacker, int damage)
  {
    L2NpcInstance actor = getActor();
    if (actor.getCurrentHpPercents() < 50 && !_teleported)
    {
      Location loc = (new Location(84968, -208728, -3367));
      actor.setSpawnedLoc(loc);
      actor.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, null, null);
      actor.teleToLocation(loc);
      _teleported = true;
      try
      {
        for (int i = 0; i < SPAWN_POINTS.length; i++)
        {
          Location oldPos = SPAWN_POINTS[i];
          L2Spawn s = new L2Spawn(NpcTable.getTemplate(LEMATANS_FOLLOWER));
          Location newPos = GeoEngine.findPointToStay(oldPos.x, oldPos.y, oldPos.z, 0, 0, actor.getReflection().getGeoIndex());
          s.setReflection(actor.getReflection().getId());
          s.setLoc(newPos);
          s.doSpawn(true);
        }
      }
      catch (Exception e)
View Full Code Here

  }

  @Override
  protected void onEvtAttacked(L2Character attacker, int damage)
  {
    L2NpcInstance actor = getActor();
    if(actor != null && attacker != null && Rnd.chance(5))
    {
      int DeBuff = DeBuffs[Rnd.get(DeBuffs.length)];
      GArray<L2Effect> effect = attacker.getEffectList().getEffectsBySkillId(DeBuff);
      if(effect != null)
View Full Code Here

        }
    }

    public void droplist() {
        L2Player player = (L2Player) getSelf();
        L2NpcInstance npc = getNpc();
        if (player == null || npc == null) {
            return;
        }
        droplist(player, npc);
    }
View Full Code Here

        }
    }

    public void quests() {
        L2Player player = (L2Player) getSelf();
        L2NpcInstance npc = getNpc();
        if (player == null || npc == null) {
            return;
        }
        StringBuilder dialog = new StringBuilder("<html><body><center><font color=\"LEVEL\">");
        dialog.append(npc.getName()).append("<br></font></center><br>");
        Quest[] list = npc.getTemplate().getEventQuests(QuestEventType.MOBKILLED);
        if (list != null && list.length != 0) {
            dialog.append("On kill:<br>");
            for (Quest q : list) {
                dialog.append(q.getDescr(player)).append("<br1>");
            }
View Full Code Here

        show(dialog.toString(), player, npc);
    }

    public void skills() {
        L2Player player = (L2Player) getSelf();
        L2NpcInstance npc = getNpc();
        if (player == null || npc == null) {
            return;
        }
        StringBuilder dialog = new StringBuilder("<html><body><center><font color=\"LEVEL\">");
        dialog.append(npc.getName()).append("<br></font></center>");
        Collection<L2Skill> list = npc.getAllSkills();
        if (list != null && !list.isEmpty()) {
            dialog.append("<br>Active:<br>");
            for (L2Skill s : list) {
                if (s.isActive()) {
                    dialog.append(s.getName()).append("<br1>");
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.instances.L2NpcInstance

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.