Package com.l2jfrozen.gameserver.model

Examples of com.l2jfrozen.gameserver.model.Location


  }
 
  @Override
  public boolean canMoveFromToTarget(int x, int y, int z, int tx, int ty, int tz)
  {
    Location destiny = moveCheck(x, y, z, tx, ty, tz);
    return (destiny.getX() == tx && destiny.getY() == ty && destiny.getZ() == tz);
  }
View Full Code Here


  }
 
  @Override
  public Location moveCheck(int x, int y, int z, int tx, int ty, int tz)
  {
    Location startpoint = new Location(x, y, z);
    if(DoorTable.getInstance().checkIfDoorsBetween(x, y, z, tx, ty, tz))
      return startpoint;

    Location destiny = new Location(tx, ty, tz);
    return moveCheck(startpoint, destiny, (x - L2World.MAP_MIN_X) >> 4, (y - L2World.MAP_MIN_Y) >> 4, z, (tx - L2World.MAP_MIN_X) >> 4, (ty - L2World.MAP_MIN_Y) >> 4, tz);
  }
View Full Code Here

        {
          d += delta_B;
          next_x += inc_x;
          tempz = nCanMoveNext(x, y, (int) z, next_x, next_y, tz);
          if(tempz == Double.MIN_VALUE)
            return new Location((x << 4) + L2World.MAP_MIN_X, (y << 4) + L2World.MAP_MIN_Y, (int) z);
          z = tempz;
          next_y += inc_y;
          //_log.warning("2: next_x:"+next_x+" next_y"+next_y);
          tempz = nCanMoveNext(next_x, y, (int) z, next_x, next_y, tz);
          if(tempz == Double.MIN_VALUE)
            return new Location((x << 4) + L2World.MAP_MIN_X, (y << 4) + L2World.MAP_MIN_Y, (int) z);
          z = tempz;
        }
        else
        {
          d += delta_A;
          next_x += inc_x;
          //_log.warning("3: next_x:"+next_x+" next_y"+next_y);
          tempz = nCanMoveNext(x, y, (int) z, next_x, next_y, tz);
          if(tempz == Double.MIN_VALUE)
            return new Location((x << 4) + L2World.MAP_MIN_X, (y << 4) + L2World.MAP_MIN_Y, (int) z);
          z = tempz;
        }
      }
    }
    else
    {
      int delta_A = 2 * dx;
      int d = delta_A - dy;
      int delta_B = delta_A - 2 * dy;
      for(int i = 0; i < dy; i++)
      {
        x = next_x;
        y = next_y;
        if(d > 0)
        {
          d += delta_B;
          next_y += inc_y;
          tempz = nCanMoveNext(x, y, (int) z, next_x, next_y, tz);
          if(tempz == Double.MIN_VALUE)
            return new Location((x << 4) + L2World.MAP_MIN_X, (y << 4) + L2World.MAP_MIN_Y, (int) z);
          z = tempz;
          next_x += inc_x;
          //_log.warning("5: next_x:"+next_x+" next_y"+next_y);
          tempz = nCanMoveNext(x, next_y, (int) z, next_x, next_y, tz);
          if(tempz == Double.MIN_VALUE)
            return new Location((x << 4) + L2World.MAP_MIN_X, (y << 4) + L2World.MAP_MIN_Y, (int) z);
          z = tempz;
        }
        else
        {
          d += delta_A;
          next_y += inc_y;
          //_log.warning("6: next_x:"+next_x+" next_y"+next_y);
          tempz = nCanMoveNext(x, y, (int) z, next_x, next_y, tz);
          if(tempz == Double.MIN_VALUE)
            return new Location((x << 4) + L2World.MAP_MIN_X, (y << 4) + L2World.MAP_MIN_Y, (int) z);
          z = tempz;
        }
      }
    }
    if(z == startpoint.getZ()) // geodata hasn't modified Z in any coordinate, i.e. doesn't exist
      return destiny;
    return new Location(destiny.getX(), destiny.getY(), (int) z);
  }
View Full Code Here

      signy = 1;
    }
    posX += signx * FEAR_RANGE;
    posY += signy * FEAR_RANGE;

    Location destiny = GeoData.getInstance().moveCheck(getEffected().getX(), getEffected().getY(), getEffected().getZ(), posX, posY, posZ);
    getEffected().setRunning();
    getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(destiny.getX(),destiny.getY(),destiny.getZ(),0));
   
    destiny = null;
    return true;
  }
View Full Code Here

    if(Math.abs(end.getZ() - tz) > 55)
      return null; // not correct layer
    if(start.equals(end))
      return null;
    // TODO: Find closest path node we CAN access. Now only checks if we can not reach the closest
    Location temp = GeoData.getInstance().moveCheck(x, y, z, start.getX(), start.getY(), start.getZ());
    if(temp.getX() != start.getX() || temp.getY() != start.getY())
      return null; //   cannot reach closest...

    // TODO: Find closest path node around target, now only checks if final location can be reached
    temp = GeoData.getInstance().moveCheck(tx, ty, tz, end.getX(), end.getY(), end.getZ());
    if(temp.getX() != end.getX() || temp.getY() != end.getY())
      return null; //   cannot reach closest...

    //return searchAStar(start, end);
    return searchByClosest2(start, end);
  }
View Full Code Here

   *
   * @return
   */
  public Location getSpawn()
  {
    return new Location(_spawnLoc[0], _spawnLoc[1], _spawnLoc[2]);
  }
View Full Code Here

   * Gets the _npc location.
   * @return the _npc location
   */
  public static Location get_npcLocation()
  {
    Location npc_loc = new Location(_npcX, _npcY, _npcZ, _npcHeading);
   
    return npc_loc;
  }
View Full Code Here

   * Gets the _players spawn location.
   * @return the _players spawn location
   */
  public static Location get_playersSpawnLocation()
  {
    Location npc_loc = new Location(_playerX + Rnd.get(Config.DM_SPAWN_OFFSET), _playerY + Rnd.get(Config.DM_SPAWN_OFFSET), _playerZ, 0);
   
    return npc_loc;
  }
View Full Code Here

   *
   * @return the _npc location
   */
  public static Location get_npcLocation()
  {
    Location npc_loc = new Location(_npcX,_npcY,_npcZ,_npcHeading);
   
    return npc_loc;
   
  }
View Full Code Here

    replyMSG.append("<br><font color=\"LEVEL\">Current event...</font><br1>");
    replyMSG.append("Name:&nbsp;<font color=\"00FF00\">" + CTF.get_eventName() + "</font><br1>");
    replyMSG.append("Description:&nbsp;<font color=\"00FF00\">" + CTF.get_eventDesc() + "</font><br1>");
    replyMSG.append("Joining location name:&nbsp;<font color=\"00FF00\">" + CTF.get_joiningLocationName() + "</font><br1>");
   
    Location npc_loc = CTF.get_npcLocation();
   
    replyMSG.append("Joining NPC ID:&nbsp;<font color=\"00FF00\">" + CTF.get_npcId() + " on pos " + npc_loc._x + "," + npc_loc._y + "," + npc_loc._z + "</font><br1>");
    replyMSG.append("<button value=\"Tele->NPC\" action=\"bypass -h admin_ctf_tele_npc\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>");
    replyMSG.append("Reward ID:&nbsp;<font color=\"00FF00\">" + CTF.get_rewardId() + "</font><br1>");
    if(ItemTable.getInstance().getTemplate(CTF.get_rewardId()) != null)
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.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.