Package net.sf.l2j.gameserver.serverpackets

Examples of net.sf.l2j.gameserver.serverpackets.ValidateLocation


                MyTargetSelected my = new MyTargetSelected(getObjectId(), 0);
                player.sendPacket(my);
            }

            // Send a Server->Client packet ValidateLocation to correct the L2NpcInstance position and heading on the client
            player.sendPacket(new ValidateLocation(this));
        }
        else
        {
            player.sendPacket(new ValidateLocation(this));
            // Check if the player is attackable (without a forced attack) and isn't dead
            if (isAutoAttackable(player) && !isAlikeDead())
            {
                // Check the height difference
                if (Math.abs(player.getZ() - getZ()) < 400) // this max heigth difference might need some tweaking
View Full Code Here


                DoorStatusUpdate su = new DoorStatusUpdate(this);
                player.sendPacket(su);
//            }

            // Send a Server->Client packet ValidateLocation to correct the L2NpcInstance position and heading on the client
            player.sendPacket(new ValidateLocation(this));
        }
        else
        {
//            MyTargetSelected my = new MyTargetSelected(getObjectId(), player.getLevel());
//            player.sendPacket(my);
View Full Code Here

      // Send a Server->Client packet MyTargetSelected to the L2PcInstance player
      player.sendPacket(new MyTargetSelected(getObjectId(), 0));

      // Send a Server->Client packet ValidateLocation to correct the L2NpcInstance position and heading on the client
      player.sendPacket(new ValidateLocation(this));
    }
    else
    {
      // Calculate the distance between the L2PcInstance and the L2NpcInstance
      if (!canInteract(player))
View Full Code Here

      // Send a Server->Client packet MyTargetSelected to the L2PcInstance player
      MyTargetSelected my = new MyTargetSelected(getObjectId(), 0);
      player.sendPacket(my);

      // Send a Server->Client packet ValidateLocation to correct the L2NpcInstance position and heading on the client
      player.sendPacket(new ValidateLocation(this));
    }
    else
    {
      // Calculate the distance between the L2PcInstance and the L2NpcInstance
      if (!canInteract(player))
View Full Code Here

      su.addAttribute(StatusUpdate.CUR_HP, (int)getStatus().getCurrentHp() );
      su.addAttribute(StatusUpdate.MAX_HP, getMaxHp() );
      player.sendPacket(su);

      // Send a Server->Client packet ValidateLocation to correct the L2NpcInstance position and heading on the client
      player.sendPacket(new ValidateLocation(this));
    }
    else
    {
      if (isAutoAttackable(player) && Math.abs(player.getZ() - getZ()) < 100)
        player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);
View Full Code Here

                    {
                        sendPacket(new ValidateLocationInVehicle(activeChar));
                    }
                    else
                    {
                      activeChar.sendPacket(new ValidateLocation(activeChar));
                    }
                }
            }
            activeChar.setLastClientPosition(_x, _y, _z);
            activeChar.setLastServerPosition(activeChar.getX(), activeChar.getY(), activeChar.getZ());
        }
        else if (Config.COORD_SYNCHRONIZE == -1)
        {
            activeChar.setClientX(_x);
            activeChar.setClientY(_y);
            activeChar.setClientZ(_z);
            activeChar.setClientHeading(_heading);
            int realX = activeChar.getX();
            int realY = activeChar.getY();
            int realZ = activeChar.getZ();

            double dx = _x - realX;
            double dy = _y - realY;
            double diffSq = (dx*dx + dy*dy);
            if (diffSq < 250000)
                activeChar.setXYZ(realX,realY,_z);
            int realHeading = activeChar.getHeading();

            //activeChar.setHeading(_heading);

            //TODO: do we need to validate?
            /*double dx = (_x - realX);
             double dy = (_y - realY);
             double dist = Math.sqrt(dx*dx + dy*dy);
             if ((dist < 500)&&(dist > 2)) //check it wasnt teleportation, and char isn't there yet
             activeChar.sendPacket(new CharMoveToLocation(activeChar));*/

            if (Config.DEBUG) {
                _log.fine("client pos: "+ _x + " "+ _y + " "+ _z +" head "+ _heading);
                _log.fine("server pos: "+ realX + " "+realY+ " "+realZ +" head "+realHeading);
            }

            if (Config.ACTIVATE_POSITION_RECORDER && !activeChar.isFlying() && Universe.getInstance().shouldLog(activeChar.getObjectId()))
                Universe.getInstance().registerHeight(realX, realY, _z);

            if (Config.DEVELOPER)
            {
                if (diffSq > 1000000) {
                    if (Config.DEBUG) _log.fine("client/server dist diff "+ (int)Math.sqrt(diffSq));
                    if (activeChar.isInBoat())
                    {
                        sendPacket(new ValidateLocationInVehicle(activeChar));
                    }
                    else
                    {
                      activeChar.sendPacket(new ValidateLocation(activeChar));
                    }
                }
            }
        }
    if(activeChar.getParty() != null)
View Full Code Here

      // Send a Server->Client packet MyTargetSelected to the player
      // The color to display in the select window is White
      player.sendPacket(new MyTargetSelected(getObjectId(), 0));
      if (player != this)
      {
        player.sendPacket(new ValidateLocation(this));
      }
    }
    else
    {
      if (player != this)
      {
        player.sendPacket(new ValidateLocation(this));
      }
      // Check if this L2PcInstance has a Private Store
      if (getPrivateStoreType() != 0)
      {
        player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this);
View Full Code Here

      // Send a Server->Client packet MyTargetSelected to the L2PcInstance player
      MyTargetSelected my = new MyTargetSelected(getObjectId(), 0);
      player.sendPacket(my);

      // Send a Server->Client packet ValidateLocation to correct the L2NpcInstance position and heading on the client
      player.sendPacket(new ValidateLocation(this));
    }
    else
    {
      // Calculate the distance between the L2PcInstance and the L2NpcInstance
      if (!canInteract(player))
View Full Code Here

      // Send a Server->Client packet MyTargetSelected to the L2PcInstance player
      player.sendPacket(new MyTargetSelected(getObjectId(), 0));

      // Send a Server->Client packet ValidateLocation to correct the L2NpcInstance position and heading on the client
      player.sendPacket(new ValidateLocation(this));
    }
    else
    {
      if (!canInteract(player))
      {
View Full Code Here

      // The color to display in the select window is White
      MyTargetSelected my = new MyTargetSelected(getObjectId(), 0);
      player.sendPacket(my);

      // Send a Server->Client packet ValidateLocation to correct the L2NpcInstance position and heading on the client
      player.sendPacket(new ValidateLocation(this));
    }
    else
    {
      // Check if the L2PcInstance is in the _aggroList of the L2GuardInstance
      if (containsTarget(player))
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.serverpackets.ValidateLocation

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.