Package l2p.util

Examples of l2p.util.Location


    entry(npcId, player);
  }

  private static void entry(int npcId, L2Player player)
  {
    Location loc = FourSepulchersSpawn._startHallSpawns.get(npcId);
    for(L2Player mem : player.getParty().getPartyMembers())
    {
      mem.teleToLocation(loc.rnd(0, 80, false));
      Functions.removeItem(mem, ENTRANCE_PASS, 1);
      if(mem.getInventory().getItemByItemId(ANTIQUE_BROOCH) == null)
      {
        Functions.addItem(mem, USED_PASS, 1);
      }
View Full Code Here


    }
  }

  private static L2NpcInstance addSpawn(int npcId, int x, int y, int z, int heading)
  {
    return Functions.spawn(new Location(x, y, z, heading), npcId);
  }
View Full Code Here

      int x = WALKS.get(event).x;
      int y = WALKS.get(event).y;
      int z = WALKS.get(event).z;
      String nextEvent = WALKS.get(event).event;
      int time = WALKS.get(event).time;
      temp_npc.moveToLocation(new Location(x, y, z), 0, true);
      startQuestTimer(nextEvent, time, temp_npc);
    }
    else if(event.equals("6") && temp_npc != null)
    {
      Functions.npcSay(temp_npc, TEXT[6]);
      temp_npc.moveToLocation(new Location(-56511, -56647, -2008, 36863), 0, true);
      temp_npc.broadcastPacket(new PlaySound(1, "NS22_F", 0, 0, new Location()));
      L2NpcInstance elf = addSpawn(singer1, -56344, -56328, -2008, 32768);
      elf.moveToLocation(new Location(-56657, -56338, -2008, 33102), 0, true);
      L2NpcInstance elf1 = addSpawn(singer2, -56552, -56245, -2008, 36863);
      L2NpcInstance elf2 = addSpawn(singer2, -56546, -56426, -2008, 28672);
      L2NpcInstance elf3 = addSpawn(singer2, -56570, -56473, -2008, 28672);
      L2NpcInstance elf4 = addSpawn(singer2, -56594, -56516, -2008, 28672);
      L2NpcInstance elf5 = addSpawn(singer2, -56580, -56203, -2008, 36863);
      L2NpcInstance elf6 = addSpawn(singer2, -56606, -56157, -2008, 36863);
      startQuestTimer("social1", 6000, elf);
      startQuestTimer("social1", 6000, elf1);
      startQuestTimer("social1", 6000, elf2);
      startQuestTimer("social1", 6000, elf3);
      startQuestTimer("social1", 6000, elf4);
      startQuestTimer("social1", 6000, elf5);
      startQuestTimer("social1", 6000, elf6);
      startQuestTimer("7", 215000, temp_npc);
      startQuestTimer("7", 215000, elf);
      startQuestTimer("7", 215000, elf1);
      startQuestTimer("7", 215000, elf2);
      startQuestTimer("7", 215000, elf3);
      startQuestTimer("7", 215000, elf4);
      startQuestTimer("7", 215000, elf5);
      startQuestTimer("7", 215000, elf6);
    }
    else if(event.equals("7") && temp_npc != null)
    {
      if(temp_npc.getNpcId() == MC)
      {
        Functions.npcSay(temp_npc, TEXT[7]);
        temp_npc.moveToLocation(new Location(-56698, -56430, -2008, 32768), 0, true);
        startQuestTimer("8", 12000, temp_npc);
      }
      else
      {
        //cancelQuestTimer("social1", npc, null);
        temp_npc.moveToLocation(new Location(-56594, -56064, -2008), 0, true);
        startQuestTimer("clean_npc", 9000, temp_npc);
      }
    }
    else if(event.equals("10") && temp_npc != null)
    {
      temp_npc.moveToLocation(new Location(-56483, -56665, -2034), 0, true);
      L2NpcInstance npc1 = addSpawn(circus1, -56495, -56375, -2008, 32768);
      L2NpcInstance npc2 = addSpawn(circus1, -56491, -56289, -2008, 32768);
      L2NpcInstance npc3 = addSpawn(circus2, -56502, -56246, -2008, 32768);
      L2NpcInstance npc4 = addSpawn(circus2, -56496, -56429, -2008, 32768);
      L2NpcInstance npc5 = addSpawn(circus3, -56505, -56334, -2008, 32768);
      L2NpcInstance npc6 = addSpawn(circus4, -56545, -56427, -2008, 32768);
      L2NpcInstance npc7 = addSpawn(circus4, -56552, -56248, -2008, 32768);
      L2NpcInstance npc8 = addSpawn(circus5, -56493, -56473, -2008, 32768);
      L2NpcInstance npc9 = addSpawn(circus5, -56504, -56201, -2008, 32768);
      temp_npc.broadcastPacket(new PlaySound(1, "TP05_F", 0, 0, new Location()));
      startQuestTimer("npc1_1", 3000, npc1);
      startQuestTimer("npc2_1", 3000, npc2);
      startQuestTimer("npc3_1", 3000, npc3);
      startQuestTimer("npc4_1", 3000, npc4);
      startQuestTimer("npc5_1", 3500, npc5);
      startQuestTimer("npc6_1", 4000, npc6);
      startQuestTimer("npc7_1", 4000, npc7);
      startQuestTimer("npc8_1", 3000, npc8);
      startQuestTimer("npc9_1", 3000, npc9);
      startQuestTimer("11", 100000, temp_npc);
      startQuestTimer("11", 100000, npc1);
      startQuestTimer("11", 100000, npc2);
      startQuestTimer("11", 100000, npc3);
      startQuestTimer("11", 100000, npc4);
      startQuestTimer("11", 100000, npc5);
      startQuestTimer("11", 100000, npc6);
      startQuestTimer("11", 100000, npc7);
      startQuestTimer("11", 100000, npc8);
      startQuestTimer("11", 100000, npc9);
    }
    else if(event.equals("11") && temp_npc != null)
    {
      if(temp_npc.getNpcId() == MC)
      {
        Functions.npcSay(temp_npc, TEXT[10]);
        temp_npc.moveToLocation(new Location(-56698, -56430, -2008), 0, true);
        startQuestTimer("12", 5000, temp_npc);
      }
      else
      {
        temp_npc.moveToLocation(new Location(-56343, -56330, -2008), 0, true);
        startQuestTimer("clean_npc", 1000, temp_npc);
      }
    }
    else if(event.equals("14") && temp_npc != null)
    {
      L2NpcInstance npc1 = addSpawn(individual1, -56700, -56385, -2008, 32768);
      startQuestTimer("social1", 2000, npc1);
      startQuestTimer("clean_npc", 49000, npc1);
      startQuestTimer("15", 7000, temp_npc);
    }
    else if(event.equals("17") && temp_npc != null)
    {
      Functions.npcSay(temp_npc, TEXT[15]);
      L2NpcInstance npc1 = addSpawn(individual2, -56700, -56340, -2008, 32768);
      startQuestTimer("social1", 2000, npc1);
      startQuestTimer("clean_npc", 32000, npc1);
      startQuestTimer("18", 9000, temp_npc);
    }
    else if(event.equals("20") && temp_npc != null)
    {
      L2NpcInstance npc1 = addSpawn(individual3, -56703, -56296, -2008, 32768);
      startQuestTimer("social1", 2000, npc1);
      startQuestTimer("clean_npc", 13000, npc1);
      startQuestTimer("21", 8000, temp_npc);
    }
    else if(event.equals("23") && temp_npc != null)
    {
      temp_npc.moveToLocation(new Location(-56702, -56340, -2008), 0, true);
      startQuestTimer("24", 2800, temp_npc);
      L2NpcInstance npc1 = addSpawn(showstuff1, -56672, -56406, -2000, 32768);
      L2NpcInstance npc2 = addSpawn(showstuff2, -56648, -56368, -2000, 32768);
      L2NpcInstance npc3 = addSpawn(showstuff3, -56608, -56338, -2000, 32768);
      L2NpcInstance npc4 = addSpawn(showstuff4, -56652, -56307, -2000, 32768);
      L2NpcInstance npc5 = addSpawn(showstuff5, -56672, -56272, -2000, 32768);
      startQuestTimer("social1", 5500, npc1);
      startQuestTimer("social1_1", 12500, npc1);
      startQuestTimer("28", 19700, npc1);
      startQuestTimer("social1", 5500, npc2);
      startQuestTimer("social1_1", 12500, npc2);
      startQuestTimer("28", 19700, npc2);
      startQuestTimer("social1", 5500, npc3);
      startQuestTimer("social1_1", 12500, npc3);
      startQuestTimer("28", 19700, npc3);
      startQuestTimer("social1", 5500, npc4);
      startQuestTimer("social1_1", 12500, npc4);
      startQuestTimer("28", 19700, npc4);
      startQuestTimer("social1", 5500, npc5);
      startQuestTimer("social1_1", 12500, npc5);
      startQuestTimer("28", 19700, npc5);
    }
    else if(event.equals("28") && temp_npc != null)
    {
      Functions.npcSay(temp_npc, "We love you.");
      startQuestTimer("social1", 1, temp_npc);
      startQuestTimer("clean_npc", 1200, temp_npc);
    }
    else if(event.equals("29") && temp_npc != null)
    {
      temp_npc.moveToLocation(new Location(-56730, -56340, -2008), 0, true);
      startQuestTimer("clean_npc", 4100, temp_npc);
      _isStarted = false;
    }
    else if((event.equals("social1") || event.equals("social1_1")) && temp_npc != null)
    {
View Full Code Here

    else if(state == 0)
    {
      state++;
      activeChar.sendPacket(Msg.THEYRE_OFF);
      activeChar.broadcastPacket(new PlaySound("S_Race"));
      activeChar.broadcastPacket(new PlaySound(0, "ItemSound2.race_start", 1, 121209259, new Location(12125, 182487, -3559)));
      activeChar.broadcastPacket(new MonRaceInfo(codes[state][0], codes[state][1], race.getMonsters(), race.getSpeeds()));
      ThreadPoolManager.getInstance().scheduleGeneral(new RunRace(codes, activeChar), 5000);
    }
  }
View Full Code Here

      {
        show(Files.read(msgSpawned, player), player, npc);
        return;
      }
    }
    player.sendPacket(new PlaySound(1, "HB01", 0, 0, new Location()));
    try
    {
      Location loc = GeoEngine.findPointToStay(npc.getX(), npc.getY(), npc.getZ(), 40, 60, npc.getReflection().getGeoIndex());
      loc.setH(Util.getHeadingTo(loc, player.getLoc()));
      L2Spawn spawn = new L2Spawn(NpcTable.getTemplate(NPC_ALEGRIA));
      spawn.setLoc(loc);
      spawn.doSpawn(true);
      ThreadPoolManager.getInstance().scheduleAi(new DeSpawnScheduleTimerTask(spawn), 180000, false);
    }
View Full Code Here

          statement2.setInt(2, type);
          rset2 = statement2.executeQuery();
          GArray<Location> locations = new GArray<Location>();
          while(rset2.next())
          {
            locations.add(new Location(rset2.getInt("locx"), rset2.getInt("locy"), rset2.getInt("locz"), rset2.getInt("heading"), rset2.getInt("npc_templateid")));
            count++;
          }
          table.put(keyNpcId, locations);
        }
        catch(Exception e)
View Full Code Here

      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT id, count, npc_templateid, locx, locy, locz, heading, respawn_delay, key_npc_id FROM four_sepulchers_spawnlist WHERE spawntype = 0 ORDER BY id");
      rset = statement.executeQuery();
      while(rset.next())
      {
        _mysteriousBoxSpawns.put(rset.getInt("key_npc_id"), new Location(rset.getInt("locx"), rset.getInt("locy"), rset.getInt("locz"), rset.getInt("heading"), rset.getInt("npc_templateid")));
      }
      _log.warning("FourSepulchersManager: Loaded " + _mysteriousBoxSpawns.size() + " Mysterious-Box spawns.");
    }
    catch(Exception e)
    {
View Full Code Here

    for(int i = 31921; i <= 31924; i++)
    {
      try
      {
        L2NpcTemplate template = NpcTable.getTemplate(i);
        Location loc = null;
        switch(i)
        {
          case 31921: // conquerors
            loc = new Location(181061, -85595, -7200, -32584);
            break;
          case 31922: // emperors
            loc = new Location(179292, -88981, -7200, -33272);
            break;
          case 31923: // sages
            loc = new Location(173202, -87004, -7200, -16248);
            break;
          case 31924: // judges
            loc = new Location(175606, -82853, -7200, -16248);
            break;
        }
        L2SepulcherNpcInstance npc = new L2SepulcherNpcInstance(IdFactory.getInstance().getNextId(), template);
        npc.onSpawn();
        npc.setSpawnedLoc(loc);
View Full Code Here

  {
    if(!FourSepulchersManager.isAttackTime())
    {
      return;
    }
    Location loc = _shadowSpawns.get(npcId);
    if(loc == null)
    {
      return;
    }
    L2NpcTemplate template = NpcTable.getTemplate(loc.id);
View Full Code Here

  {
    int locNo = Rnd.get(4);
    int[] gateKeeper = {31929, 31934, 31939, 31944};
    for(int i = 0; i <= 3; i++)
    {
      Location loc = _shadowSpawns.get(gateKeeper[i]);
      // Обновляем только координаты, не npcId.
      loc.x = _shadowSpawnLoc[locNo][i].x;
      loc.y = _shadowSpawnLoc[locNo][i].y;
      loc.z = _shadowSpawnLoc[locNo][i].z;
      loc.h = _shadowSpawnLoc[locNo][i].h;
View Full Code Here

TOP

Related Classes of l2p.util.Location

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.