Package l2p.gameserver.model

Examples of l2p.gameserver.model.L2Territory$Point


                               interleave);
    }

    public static long shuffle(Space space, double x, double y)
    {
        Point point = new Point(x, y);
        long[] zValues = new long[1];
        space.decompose(point, zValues);
        long z = zValues[0];
        assert z != Space.Z_NULL;
        return z;
View Full Code Here


                    }
                    pbits.write(0, bits, 0, bits.length);
                    SIZE size = new SIZE();
                    size.cx = w;
                    size.cy = h;
                    POINT srcLoc = new POINT();
                    BLENDFUNCTION blend = new BLENDFUNCTION();
                    POINT loc = new POINT();
                    loc.x = win.getX();
                    loc.y = win.getY();
                    HWND hWnd = getHWnd(win);
                    // extract current constant alpha setting, if possible
                    ByteByReference bref = new ByteByReference();
View Full Code Here

                pbits.write(0, bits, 0, bits.length);
               
                SIZE size = new SIZE();
                size.cx = w;
                size.cy = h;
                POINT loc = new POINT();
                loc.x = alphaWindow.getX();
                loc.y = alphaWindow.getY();
                POINT srcLoc = new POINT();
                BLENDFUNCTION blend = new BLENDFUNCTION();
                blend.SourceConstantAlpha = (byte)(alpha * 255);
                blend.AlphaFormat = User32.AC_SRC_ALPHA;
                user.UpdateLayeredWindow(hWnd, screenDC, loc, size, memDC, srcLoc,
                                         0, blend, User32.ULW_ALPHA);
View Full Code Here

            List sizes = new ArrayList();
            while (!pi.isDone()) {
                int type = pi.currentSegment(coords);
                if (type == PathIterator.SEG_MOVETO) {
                    size = 1;
                    points.add(new POINT((int)coords[0], (int)coords[1]));
                }
                else if (type == PathIterator.SEG_LINETO) {
                    ++size;
                    points.add(new POINT((int)coords[0], (int)coords[1]));
                }
                else if (type == PathIterator.SEG_CLOSE) {
                    sizes.add(new Integer(size));
                }
                else {
                    throw new RuntimeException("Area is not polygonal: " + area);
                }
                pi.next();
            }
            POINT[] lppt = (POINT[])new POINT().toArray(points.size());
            POINT[] pts = (POINT[])points.toArray(new POINT[points.size()]);
            for (int i=0;i < lppt.length;i++) {
                lppt[i].x = pts[i].x;
                lppt[i].y = pts[i].y;
            }
View Full Code Here

                        pbits.write((v*ww+origin.x)*4, bits, 0, bits.length);
                    }
                    SIZE winSize = new SIZE();
                    winSize.cx = win.getWidth();
                    winSize.cy = win.getHeight();
                    POINT winLoc = new POINT();
                    winLoc.x = win.getX();
                    winLoc.y = win.getY();
                    POINT srcLoc = new POINT();
                    BLENDFUNCTION blend = new BLENDFUNCTION();
                    HWND hWnd = getHWnd(win);
                    // extract current constant alpha setting, if possible
                    ByteByReference bref = new ByteByReference();
                    IntByReference iref = new IntByReference();
View Full Code Here

                pbits.write(0, bits, 0, bits.length);
               
                SIZE size = new SIZE();
                size.cx = w;
                size.cy = h;
                POINT loc = new POINT();
                loc.x = alphaWindow.getX();
                loc.y = alphaWindow.getY();
                POINT srcLoc = new POINT();
                BLENDFUNCTION blend = new BLENDFUNCTION();
                blend.SourceConstantAlpha = (byte)(alpha * 255);
                blend.AlphaFormat = User32.AC_SRC_ALPHA;
                user.UpdateLayeredWindow(hWnd, screenDC, loc, size, memDC, srcLoc,
                                         0, blend, User32.ULW_ALPHA);
View Full Code Here

       
        String description = "";
        if ( fdbo.getString("description") != null )
          description = fdbo.getString("description");
                 
        Point placemark = placemarksFolder.createAndAddPlacemark()
           .withName(fdbo.getString("title")).withOpen(Boolean.TRUE)
           .withDescription(description)
           .createAndSetPoint().addToCoordinates(-0.126236, 51.500152);
      }
    }
View Full Code Here

          int location = spawn.getLocation();
          if(location == 0)
          {
            continue;
          }
          L2Territory terr = TerritoryTable.getInstance().getLocation(location);
          if(terr == null)
          {
            continue;
          }
          if(terr.isInside(activeChar.getX(), activeChar.getY()))
          {
            activeChar.sendMessage("Territory: " + terr.getId());
          }
        }
        break;
      }
      case admin_region:
      {
        activeChar.sendMessage("Current region: " + activeChar.getCurrentRegion().getName());
        activeChar.sendMessage("Objects list:");
        for(L2Object o : activeChar.getCurrentRegion().getObjectsList(new GArray<L2Object>(activeChar.getCurrentRegion().getObjectsSize()), 0, activeChar.getReflection()))
        {
          if(o != null)
          {
            activeChar.sendMessage(o.toString());
          }
        }
        break;
      }
      case admin_vis_count:
      {
        activeChar.sendMessage("Players count: " + L2World.getAroundPlayers(activeChar).size());
        break;
      }
      /*
             * Пишет в консоль текущую точку для локации, оформляем в виде SQL запроса
             * пример: (8699,'loc_8699',111104,-112528,-1400,-1200),
             * Удобно для рисования локаций под спавн, разброс z +100/-10
             * необязательные параметры: id локации и название локации
             * Бросает бутылку, чтобы не запутаццо :)
             */
      case admin_loc:
      {
        String loc_id = "0";
        String loc_name;
        if(wordList.length > 1)
        {
          loc_id = wordList[1];
        }
        if(wordList.length > 2)
        {
          loc_name = wordList[2];
        }
        else
        {
          loc_name = "loc_" + loc_id;
        }
        //System.out.println("  (" + loc_id + ",'" + loc_name + "'," + activeChar.getX() + "," + activeChar.getY() + "," + activeChar.getZ() + "," + (activeChar.getZ() + 100) + ",0),");
        System.out.println("<point xyzz=\"" + activeChar.getX() + " " + activeChar.getY() + " " + activeChar.getZ() + " " + (activeChar.getZ() + 100) + "\"/>");
        activeChar.sendMessage("Point saved.");
        L2ItemInstance temp = ItemTable.getInstance().createItem(1060);
        temp.dropMe(activeChar, activeChar.getLoc());
        break;
      }
      case admin_xloc:
      {
        System.out.println("      <coords loc=\"" + activeChar.getX() + " " + activeChar.getY() + " " + activeChar.getZ() + " 0\" />");
        activeChar.sendMessage("Point saved.");
        L2ItemInstance temp = ItemTable.getInstance().createItem(1060);
        temp.dropMe(activeChar, activeChar.getLoc());
        break;
      }
      case admin_pos:
        String pos = activeChar.getX() + ", " + activeChar.getY() + ", " + activeChar.getZ() + ", " + activeChar.getHeading() + " Geo [" + (activeChar.getX() - L2World.MAP_MIN_X >> 4) + ", " + (activeChar.getY() - L2World.MAP_MIN_Y >> 4) + "] Ref " + activeChar.getReflection().getId();
        System.out.println(activeChar.getName() + "'s position: " + pos);
        activeChar.sendMessage("Pos: " + pos);
        break;
      case admin_location:
        locationMenu(activeChar);
        break;
      case admin_loc_begin:
      {
        if(wordList.length < 2)
        {
          activeChar.sendMessage("Usage: //loc_begin <location_id>");
          locationMenu(activeChar);
          return false;
        }
        try
        {
          create_loc_id = Integer.valueOf(wordList[1]);
        }
        catch(Exception E)
        {
          activeChar.sendMessage("location_id should be integer");
          create_loc = null;
          locationMenu(activeChar);
          return false;
        }
        create_loc = new GArray<int[]>();
        create_loc.add(new int[] {activeChar.getX(), activeChar.getY(), activeChar.getZ(), activeChar.getZ() + 100});
        activeChar.sendMessage("Now you can add points...");
        activeChar.sendPacket(new ExShowTrace());
        locationMenu(activeChar);
        break;
      }
      case admin_loc_add:
      {
        if(create_loc == null)
        {
          activeChar.sendMessage("Location not started");
          locationMenu(activeChar);
          return false;
        }
        create_loc.add(new int[] {activeChar.getX(), activeChar.getY(), activeChar.getZ(), activeChar.getZ() + 100});
        if(create_loc.size() > 1)
        {
          activeChar.sendPacket(Points2Trace(create_loc, 50, false, false));
        }
        if(wordList.length > 1 && wordList[1].equals("menu"))
        {
          locationMenu(activeChar);
        }
        break;
      }
      case admin_loc_reset:
      {
        if(create_loc == null)
        {
          activeChar.sendMessage("Location not started");
          locationMenu(activeChar);
          return false;
        }
        create_loc.clear();
        activeChar.sendPacket(new ExShowTrace());
        locationMenu(activeChar);
        break;
      }
      case admin_loc_end:
      {
        if(create_loc == null)
        {
          activeChar.sendMessage("Location not started");
          locationMenu(activeChar);
          return false;
        }
        if(create_loc.size() < 3)
        {
          activeChar.sendMessage("Minimum location size 3 points");
          locationMenu(activeChar);
          return false;
        }
        String prefix = "(" + create_loc_id + ",'loc_" + create_loc_id + "',";
        for(int[] _p : create_loc)
        {
          System.out.println(prefix + _p[0] + "," + _p[1] + "," + _p[2] + "," + _p[3] + ", 0),");
        }
        System.out.println("");
        activeChar.sendPacket(Points2Trace(create_loc, 50, true, false));
        create_loc = null;
        create_loc_id = 0;
        activeChar.sendMessage("Location Created, check stdout");
        if(wordList.length > 1 && wordList[1].equals("menu"))
        {
          locationMenu(activeChar);
        }
        break;
      }
      case admin_showloc:
      {
        if(wordList.length < 2)
        {
          activeChar.sendMessage("Usage: //showloc <location>");
          return false;
        }
        String loc_id = wordList[1];
        L2Territory terr = TerritoryTable.getInstance().getLocations().get(Integer.parseInt(loc_id));
        if(terr == null)
        {
          activeChar.sendMessage("Location <" + loc_id + "> undefined.");
          return false;
        }
        if(!terr.isInside(activeChar.getX(), activeChar.getY()))
        {
          int[] _loc = terr.getRandomPoint();
          activeChar.teleToLocation(_loc[0], _loc[1], _loc[2]);
        }
        activeChar.sendPacket(Points2Trace(terr.getCoords(), 50, true, false));
        if(wordList.length > 2 && wordList[2].equals("menu"))
        {
          locationMenu(activeChar);
        }
        break;
      }
      case admin_loc_remove:
      {
        if(wordList.length < 2)
        {
          activeChar.sendMessage("Usage: //showloc <location>");
          return false;
        }
        if(create_loc == null)
        {
          activeChar.sendMessage("Location not started");
          locationMenu(activeChar);
          return false;
        }
        int point_id = Integer.parseInt(wordList[1]);
        create_loc.remove(point_id);
        if(create_loc.size() > 1)
        {
          activeChar.sendPacket(Points2Trace(create_loc, 50, false, false));
        }
        locationMenu(activeChar);
        break;
      }
      case admin_show_locations:
      {
        for(L2Territory terr : TerritoryTable.getInstance().getLocations().values())
        {
          if(activeChar.isInRange(terr.getCenter(), 2000))
          {
            activeChar.sendPacket(Points2Trace(terr.getCoords(), 50, true, false));
          }
        }
        for(L2Territory terr : TerritoryTable.getInstance().getLocations().values())
        {
          if(activeChar.isInRange(terr.getCenter(), 2000))
          {
            activeChar.sendPacket(Points2Trace(terr.getCoords(), 50, true, true));
          }
        }
        break;
      }
    }
View Full Code Here

        {
          activeChar.sendMessage("->" + targetName + "<- is incorrect.");
        }
        break;
      case admin_fix_gh_1:
        L2Territory gh_spawn_loc;
        // Зона крафта
        gh_spawn_loc = new L2Territory(10000001);
        gh_spawn_loc.add(45704, 186617, -3480, -3380);
        gh_spawn_loc.add(46086, 186419, -3488, -3388);
        gh_spawn_loc.add(46733, 187506, -3480, -3380);
        gh_spawn_loc.add(46294, 187709, -3480, -3380);
        for(L2Player player : L2ObjectsStorage.getAllPlayers())
        {
          if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_MANUFACTURE && player.getReflection().getId() == -2)
          {
            int[] point = gh_spawn_loc.getRandomPoint();
            player.decayMe();
            player.setXYZ(point[0], point[1], point[2]);
            player.spawnMe();
          }
        }
        // Зона покупки
        gh_spawn_loc = new L2Territory(10000002);
        gh_spawn_loc.add(46091, 186412, -3488, -3388);
        gh_spawn_loc.add(47218, 185902, -3488, -3388);
        gh_spawn_loc.add(47761, 186929, -3480, -3380);
        gh_spawn_loc.add(46742, 187511, -3480, -3380);
        for(L2Player player : L2ObjectsStorage.getAllPlayers())
        {
          if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_BUY && player.getReflection().getId() == -2)
          {
            int[] point = gh_spawn_loc.getRandomPoint();
            player.decayMe();
            player.setXYZ(point[0], point[1], point[2]);
            player.spawnMe();
          }
        }
        // Зона продажи
        gh_spawn_loc = new L2Territory(10000003);
        gh_spawn_loc.add(47665, 186755, -3480, -3380);
        gh_spawn_loc.add(48167, 186488, -3480, -3380);
        gh_spawn_loc.add(48397, 186625, -3480, -3380);
        gh_spawn_loc.add(50156, 184674, -3488, -3388);
        gh_spawn_loc.add(49292, 183916, -3488, -3388);
        gh_spawn_loc.add(47758, 185654, -3488, -3388);
        gh_spawn_loc.add(47244, 185894, -3488, -3388);
        for(L2Player player : L2ObjectsStorage.getAllPlayers())
        {
          if((player.getPrivateStoreType() == L2Player.STORE_PRIVATE_SELL || player.getPrivateStoreType() == L2Player.STORE_PRIVATE_SELL_PACKAGE) && player.getReflection().getId() == -2)
          {
            int[] point = gh_spawn_loc.getRandomPoint();
            player.decayMe();
            player.setXYZ(point[0], point[1], point[2]);
            player.spawnMe();
          }
        }
        break;
      case admin_fix_gh_2:
        L2Territory gh_spawn_loc2;
        // Зона покупки
        gh_spawn_loc2 = new L2Territory(10000004);
        gh_spawn_loc2.add(46091, 186412, -3488, -3388);
        gh_spawn_loc2.add(47218, 185902, -3488, -3388);
        gh_spawn_loc2.add(47761, 186929, -3480, -3380);
        gh_spawn_loc2.add(46742, 187511, -3480, -3380);
        for(L2Player player : L2ObjectsStorage.getAllPlayers())
        {
          if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_BUY)
          {
            int[] point = gh_spawn_loc2.getRandomPoint();
            player.decayMe();
            if(player.getReflection().getId() != -2)
            {
              player.setVar("backCoords", player.getLoc().toXYZString());
              player.setReflection(-2);
            }
            player.setXYZ(point[0], point[1], point[2]);
            player.spawnMe();
          }
        }
        // Зона крафта
        gh_spawn_loc2 = new L2Territory(10000005);
        gh_spawn_loc2.add(45704, 186617, -3480, -3380);
        gh_spawn_loc2.add(46086, 186419, -3488, -3388);
        gh_spawn_loc2.add(46733, 187506, -3480, -3380);
        gh_spawn_loc2.add(46294, 187709, -3480, -3380);
        for(L2Player player : L2ObjectsStorage.getAllPlayers())
        {
          if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_MANUFACTURE)
          {
            int[] point = gh_spawn_loc2.getRandomPoint();
            player.decayMe();
            if(player.getReflection().getId() != -2)
            {
              player.setVar("backCoords", player.getLoc().toXYZString());
              player.setReflection(-2);
            }
            player.setXYZ(point[0], point[1], point[2]);
            player.spawnMe();
          }
        }
        // Зона продажи
        gh_spawn_loc2 = new L2Territory(10000006);
        gh_spawn_loc2.add(47665, 186755, -3480, -3380);
        gh_spawn_loc2.add(48167, 186488, -3480, -3380);
        gh_spawn_loc2.add(48397, 186625, -3480, -3380);
        gh_spawn_loc2.add(50156, 184674, -3488, -3388);
        gh_spawn_loc2.add(49292, 183916, -3488, -3388);
        gh_spawn_loc2.add(47758, 185654, -3488, -3388);
        gh_spawn_loc2.add(47244, 185894, -3488, -3388);
        for(L2Player player : L2ObjectsStorage.getAllPlayers())
        {
          if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_SELL || player.getPrivateStoreType() == L2Player.STORE_PRIVATE_SELL_PACKAGE)
          {
            int[] point = gh_spawn_loc2.getRandomPoint();
            player.decayMe();
            if(player.getReflection().getId() != -2)
            {
              player.setVar("backCoords", player.getLoc().toXYZString());
              player.setReflection(-2);
            }
            player.setXYZ(point[0], point[1], point[2]);
            player.spawnMe();
          }
        }
        break;
      case admin_fix_gh_r:
        int radius = 500;
        if(wordList.length > 1)
        {
          radius = Integer.parseInt(wordList[1]);
        }
        L2Territory spawn_loc;
        // Зона покупки
        spawn_loc = new L2Territory(10000004);
        spawn_loc.add(46091, 186412, -3488, -3388);
        spawn_loc.add(47218, 185902, -3488, -3388);
        spawn_loc.add(47761, 186929, -3480, -3380);
        spawn_loc.add(46742, 187511, -3480, -3380);
        for(L2Player player : L2World.getAroundPlayers(activeChar, radius, 200))
        {
          if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_BUY)
          {
            int[] point = spawn_loc.getRandomPoint();
            player.decayMe();
            if(player.getReflection().getId() != -2)
            {
              player.setVar("backCoords", player.getLoc().toXYZString());
              player.setReflection(-2);
            }
            player.setXYZ(point[0], point[1], point[2]);
            player.spawnMe();
          }
        }
        // Зона крафта
        spawn_loc = new L2Territory(10000005);
        spawn_loc.add(45704, 186617, -3480, -3380);
        spawn_loc.add(46086, 186419, -3488, -3388);
        spawn_loc.add(46733, 187506, -3480, -3380);
        spawn_loc.add(46294, 187709, -3480, -3380);
        for(L2Player player : L2World.getAroundPlayers(activeChar, radius, 200))
        {
          if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_MANUFACTURE)
          {
            int[] point = spawn_loc.getRandomPoint();
            player.decayMe();
            if(player.getReflection().getId() != -2)
            {
              player.setVar("backCoords", player.getLoc().toXYZString());
              player.setReflection(-2);
            }
            player.setXYZ(point[0], point[1], point[2]);
            player.spawnMe();
          }
        }
        // Зона продажи
        spawn_loc = new L2Territory(10000006);
        spawn_loc.add(47665, 186755, -3480, -3380);
        spawn_loc.add(48167, 186488, -3480, -3380);
        spawn_loc.add(48397, 186625, -3480, -3380);
        spawn_loc.add(50156, 184674, -3488, -3388);
        spawn_loc.add(49292, 183916, -3488, -3388);
        spawn_loc.add(47758, 185654, -3488, -3388);
        spawn_loc.add(47244, 185894, -3488, -3388);
        for(L2Player player : L2World.getAroundPlayers(activeChar, radius, 200))
        {
          if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_SELL || player.getPrivateStoreType() == L2Player.STORE_PRIVATE_SELL_PACKAGE)
          {
            int[] point = spawn_loc.getRandomPoint();
            player.decayMe();
            if(player.getReflection().getId() != -2)
            {
              player.setVar("backCoords", player.getLoc().toXYZString());
              player.setReflection(-2);
View Full Code Here

                      {
                        spawnType = 0;
                        _log.warning("Spawn type  '" + spawnTypeNode.getNodeValue() + "' is unknown!");
                      }
                      int locId = IdFactory.getInstance().getNextId();
                      L2Territory territory = new L2Territory(locId);
                      for(Node location = spawn.getFirstChild(); location != null; location = location.getNextSibling())
                      {
                        if("coords".equalsIgnoreCase(location.getNodeName()))
                        {
                          territory.add(new Location(location.getAttributes().getNamedItem("loc").getNodeValue()));
                        }
                      }
                      if(spawnType == 2) //точечный спавн не проверять
                      {
                        territory.validate();
                      }
                      TerritoryTable.getInstance().getLocations().put(locId, territory);
                      L2World.addTerritory(territory);
                      for(String mob : mobs)
                      {
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.L2Territory$Point

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.