Package l2p.gameserver.model

Examples of l2p.gameserver.model.L2Territory


    reloadData();
  }

  public L2Territory getLocation(int terr)
  {
    L2Territory t = _locations.get(terr);
    if(t == null)
    {
      _log.warning("TerritoryTable.getLocation: territory " + terr + " not found.");
    }
    return t;
View Full Code Here


    return t;
  }

  public int[] getRandomPoint(int terr)
  {
    L2Territory t = _locations.get(terr);
    if(t == null)
    {
      _log.warning("TerritoryTable.getRandomPoint: territory " + terr + " not found.");
      return new int[3];
    }
    return t.getRandomPoint();
  }
View Full Code Here

    return t.getRandomPoint();
  }

  public int getMinZ(int terr)
  {
    L2Territory t = _locations.get(terr);
    if(t == null)
    {
      _log.warning("TerritoryTable.getMinZ: territory " + terr + " not found.");
      return 0;
    }
    return t.getZmin();
  }
View Full Code Here

    return t.getZmin();
  }

  public int getMaxZ(int terr)
  {
    L2Territory t = _locations.get(terr);
    if(t == null)
    {
      _log.warning("TerritoryTable.getMaxZ: territory " + terr + " not found.");
      return 0;
    }
    return t.getZmax();
  }
View Full Code Here

        }
        else
        {
          if(_locations.get(terr) == null)
          {
            L2Territory t = new L2Territory(terr);
            _locations.put(terr, t);
          }
          _locations.get(terr).add(rset.getInt("loc_x"), rset.getInt("loc_y"), rset.getInt("loc_zmin"), rset.getInt("loc_zmax"));
        }
      }
    }
    catch(Exception e1)
    {
      //problem with initializing spawn, go to next one
      _log.warning("locations couldnt be initialized:" + e1);
    }
    finally
    {
      DatabaseUtils.closeDatabaseCSR(con, statement, rset);
    }
    for(L2Territory t : _locations.values())
    {
      t.validate();
    }
    _log.info("TerritoryTable: Loaded " + _locations.size() + " locations");
  }
View Full Code Here

              }
              else if("shape".equalsIgnoreCase(e.getNodeName()) || "restart_point".equalsIgnoreCase(e.getNodeName()) || "PKrestart_point".equalsIgnoreCase(e.getNodeName()))
              {
                int locId = IdFactory.getInstance().getNextId();
                boolean isRound = !XMLUtil.getAttributeValue(e, "loc").isEmpty();
                L2Territory territory;
                if(isRound)
                {
                  String[] coord = XMLUtil.getAttributeValue(e, "loc").replaceAll(",", " ").replaceAll(";", " ").replaceAll("  ", " ").trim().split(" ");
                  if(coord.length < 5) // Не указаны minZ и maxZ, берем граничные значения
                  {
                    territory = new L2RoundTerritory(locId, Integer.parseInt(coord[0]), Integer.parseInt(coord[1]), Integer.parseInt(coord[2]), Integer.MIN_VALUE, Integer.MAX_VALUE);
                  }
                  else
                  {
                    territory = new L2RoundTerritory(locId, Integer.parseInt(coord[0]), Integer.parseInt(coord[1]), Integer.parseInt(coord[2]), Integer.parseInt(coord[3]), Integer.parseInt(coord[4]));
                  }
                }
                else
                {
                  territory = new L2Territory(locId);
                  for(Node location = e.getFirstChild(); location != null; location = location.getNextSibling())
                  {
                    if("coords".equalsIgnoreCase(location.getNodeName()))
                    {
                      String[] coord = XMLUtil.getAttributeValue(location, "loc").replaceAll(",", " ").replaceAll(";", " ").replaceAll("  ", " ").trim().split(" ");
                      if(coord.length < 4) // Не указаны minZ и maxZ, берем граничные значения
                      {
                        territory.add(Integer.parseInt(coord[0]), Integer.parseInt(coord[1]), Integer.MIN_VALUE, Integer.MAX_VALUE);
                      }
                      else
                      {
                        territory.add(Integer.parseInt(coord[0]), Integer.parseInt(coord[1]), Integer.parseInt(coord[2]), Integer.parseInt(coord[3]));
                      }
                    }
                  }
                }
                if("shape".equalsIgnoreCase(e.getNodeName()))
                {
                  z.setLoc(territory);
                  territory.setZone(z);
                  territory.validate();
                }
                else if("restart_point".equalsIgnoreCase(e.getNodeName()))
                {
                  z.setRestartPoints(territory);
                }
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.L2Territory

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.