Package l2p.util

Examples of l2p.util.Location


    L2NpcInstance actor = getActor();
    if(actor == null)
    {
      return;
    }
    Location pos;
    L2Character hated;
    // Спавним 9 копий
    for(int i = 0; i < 9; i++)
    {
      try
View Full Code Here


  public void onLoad()
  {
    AdminCommandHandler.getInstance().registerAdminCommandHandler(this);
    // init jail reflection
    ReflectionTable.getInstance().get(-3, true).setCoreLoc(new Location(-114648, -249384, -2984));
  }
View Full Code Here

      mob.setRunning();
      mob.getAI().setMaxPursueRange(20000);
      mob.getAI().setGlobalAggro(0);
      // После спауна мобы бегут к тиату или в фортресс, если тиата еще нету
      L2NpcInstance tiat = findTiat(r.getId());
      Location homeLoc;
      if(tiat != null && !tiat.isDead())
      {
        homeLoc = Rnd.coordsRandomize(tiat.getLoc(), 200, 500);
        mob.setSpawnedLoc(homeLoc);
        mob.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, tiat.getRandomHated(), 1);
View Full Code Here

    if(actor == null || System.currentTimeMillis() - _lastTeleport < 10000)
    {
      return false;
    }
    boolean randomWalk = actor.hasRandomWalk();
    Location sloc = actor.getSpawnedLoc();
    if(sloc == null)
    {
      return false;
    }
    // Random walk or not?
    if(randomWalk && (!Config.RND_WALK || Rnd.chance(Config.RND_WALK_RATE)))
    {
      return false;
    }
    if(!randomWalk && actor.isInRangeZ(sloc, Config.MAX_DRIFT_RANGE))
    {
      return false;
    }
    int x = sloc.x + Rnd.get(-Config.MAX_DRIFT_RANGE, Config.MAX_DRIFT_RANGE);
    int y = sloc.y + Rnd.get(-Config.MAX_DRIFT_RANGE, Config.MAX_DRIFT_RANGE);
    int z = GeoEngine.getHeight(x, y, sloc.z, actor.getReflection().getGeoIndex());
    if(sloc.z - z > 64)
    {
      return false;
    }
    L2Spawn spawn = actor.getSpawn();
    if(spawn != null && spawn.getLocation() != 0 && !TerritoryTable.getInstance().getLocation(spawn.getLocation()).isInside(x, y))
    {
      return false;
    }
    actor.broadcastPacketToOthers(new MagicSkillUse(actor, actor, 4671, 1, 500, 0));
    ThreadPoolManager.getInstance().scheduleAi(new Teleport(new Location(x, y, z)), 500, false);
    _lastTeleport = System.currentTimeMillis();
    return true;
  }
View Full Code Here

    L2NpcInstance actor = getActor();
    if(actor == null)
    {
      return false;
    }
    Location sloc = actor.getSpawnedLoc();
    int x = sloc.x + Rnd.get(2 * WALK_RANGE) - WALK_RANGE;
    int y = sloc.y + Rnd.get(2 * WALK_RANGE) - WALK_RANGE;
    int z = GeoEngine.getHeight(x, y, sloc.z, actor.getReflection().getGeoIndex());
    actor.setRunning();
    actor.moveToLocation(x, y, z, 0, true);
View Full Code Here

        {
          if(cha.isAirShip())
          {
            activeChar._stablePoint = activeChar.getLoc().setH(0);
            L2AirShip airship = (L2AirShip) cha;
            activeChar.setInVehiclePosition(new Location());
            activeChar.setLoc(airship.getLoc());
            activeChar.setVehicle(airship);
            activeChar.broadcastPacket(new ExGetOnAirShip(activeChar, airship, activeChar.getInVehiclePosition()));
            break;
          }
        }
        break;
      case admin_airship_invite:
        if(activeChar.getVehicle() == null)
        {
          break;
        }
        L2Player target = null;
        L2Object obj = activeChar.getTarget();
        if(obj != null && obj.isPlayer())
        {
          target = (L2Player) obj;
          L2AirShip airship = (L2AirShip) activeChar.getVehicle();
          target.setInVehiclePosition(new Location());
          target.setLoc(airship.getLoc());
          target.setVehicle(airship);
          target.broadcastPacket(new ExGetOnAirShip(target, airship, target.getInVehiclePosition()));
        }
        break;
View Full Code Here

      _mobsNotSpawned = false;
      for(int i = 0; i < MOBS_COUNT; i++)
      {
        try
        {
          Location pos = GeoEngine.findPointToStay(actor.getX(), actor.getY(), actor.getZ(), 100, 120, actor.getReflection().getGeoIndex());
          L2Spawn sp = new L2Spawn(NpcTable.getTemplate(MOBS));
          sp.setLoc(pos);
          L2NpcInstance npc = sp.doSpawn(true);
          if(caster.isPet() || caster.isSummon())
          {
View Full Code Here

    {
      return false;
    }
    for(int i = 0; i < points.length; i++)
    {
      Location loc = points[Rnd.get(points.length)];
      if(actor.getLoc().equals(loc))
      {
        continue;
      }
      actor.broadcastPacketToOthers(new MagicSkillUse(actor, actor, 4671, 1, 500, 0));
View Full Code Here

      {
        StringTokenizer st2 = new StringTokenizer(coords, " ");
        int x = Integer.parseInt(st2.nextToken());
        int y = Integer.parseInt(st2.nextToken());
        int z = Integer.parseInt(st2.nextToken());
        ThreadPoolManager.getInstance().scheduleGeneral(new L2ObjectTasks.TeleportTask(player, new Location(x, y, z), 0), Config.COMMUNITY_TELEPORT_DELAY);
      }
    }
    else if(command.startsWith("_bbsteleport_save"))
    {
      if(player.isInZone(ZoneType.Castle) ||
View Full Code Here

    {
      player = killer.getPlayer();
    }
    if(player != null)
    {
      player.getReflection().setReturnLoc(new Location(-19016, 280088, -8287));
      player.getReflection().setCoreLoc(player.getReflection().getReturnLoc());
      player.getReflection().startCollapseTimer(30 * 1000);
    }
    super.onEvtDead(killer);
  }
 
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.