Package net.sf.l2j.gameserver.serverpackets

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


                {
                  otherPlayer.getPosition().setWorldPosition(otherPlayer.getBoat().getPosition().getWorldPosition());
                  getActiveChar().sendPacket(new CharInfo(otherPlayer));
                  int relation = otherPlayer.getRelation(getActiveChar());
                  if (otherPlayer.getKnownList().getKnownRelations().get(getActiveChar().getObjectId()) != null && otherPlayer.getKnownList().getKnownRelations().get(getActiveChar().getObjectId()) != relation)
                    getActiveChar().sendPacket(new RelationChanged(otherPlayer, relation, getActiveChar().isAutoAttackable(otherPlayer)));
                  getActiveChar().sendPacket(new GetOnVehicle(otherPlayer, otherPlayer.getBoat(), otherPlayer.getInBoatPosition().getX(), otherPlayer.getInBoatPosition().getY(), otherPlayer.getInBoatPosition().getZ()));
                  /*if(otherPlayer.getBoat().GetVehicleDeparture() == null)
                  {

                    int xboat = otherPlayer.getBoat().getX();
                    int yboat= otherPlayer.getBoat().getY();
                    double modifier = Math.PI/2;
                    if (yboat == 0)
                    {
                      yboat = 1;
                    }
                    if(yboat < 0)
                    {
                      modifier = -modifier;
                    }
                    double angleboat = modifier - Math.atan(xboat/yboat);
                    int xp = otherPlayer.getX();
                    int yp = otherPlayer.getY();
                    modifier = Math.PI/2;
                    if (yp == 0)
                    {
                      yboat = 1;
                    }
                    if(yboat < 0)
                    {
                      modifier = -modifier;
                    }
                    double anglep = modifier - Math.atan(yp/xp);

                    double finx = Math.cos(anglep - angleboat)*Math.sqrt(xp *xp +yp*yp ) + Math.cos(angleboat)*Math.sqrt(xboat *xboat +yboat*yboat );
                    double finy = Math.sin(anglep - angleboat)*Math.sqrt(xp *xp +yp*yp ) + Math.sin(angleboat)*Math.sqrt(xboat *xboat +yboat*yboat );
                    //otherPlayer.getPosition().setWorldPosition(otherPlayer.getBoat().getX() - otherPlayer.getInBoatPosition().x,otherPlayer.getBoat().getY() - otherPlayer.getInBoatPosition().y,otherPlayer.getBoat().getZ()- otherPlayer.getInBoatPosition().z);
                    otherPlayer.getPosition().setWorldPosition((int)finx,(int)finy,otherPlayer.getBoat().getZ()- otherPlayer.getInBoatPosition().z);

                  }*/
                }
                else
                {
                  getActiveChar().sendPacket(new CharInfo(otherPlayer));
                  int relation = otherPlayer.getRelation(getActiveChar());
                  if (otherPlayer.getKnownList().getKnownRelations().get(getActiveChar().getObjectId()) != null && otherPlayer.getKnownList().getKnownRelations().get(getActiveChar().getObjectId()) != relation)
                    getActiveChar().sendPacket(new RelationChanged(otherPlayer, relation, getActiveChar().isAutoAttackable(otherPlayer)));
                }

                if (otherPlayer.getPrivateStoreType() == L2PcInstance.STORE_PRIVATE_SELL)
                  getActiveChar().sendPacket(new PrivateStoreMsgSell(otherPlayer));
                else if (otherPlayer.getPrivateStoreType() == L2PcInstance.STORE_PRIVATE_BUY)
View Full Code Here


             player.sendPacket(mov);
             if (mov instanceof CharInfo && character instanceof L2PcInstance)
             {
               int relation = ((L2PcInstance)character).getRelation(player);
               if (character.getKnownList().getKnownRelations().get(player.getObjectId()) != null && character.getKnownList().getKnownRelations().get(player.getObjectId()) != relation)
                 player.sendPacket(new RelationChanged((L2PcInstance)character, relation, player.isAutoAttackable(character)));
             }
           }
           catch (NullPointerException e) { }
        }
    }
View Full Code Here

        if ((mov instanceof CharInfo) && (this instanceof L2PcInstance))
        {
          int relation = ((L2PcInstance) this).getRelation(player);
          if ((getKnownList().getKnownRelations().get(player.getObjectId()) != null) && (getKnownList().getKnownRelations().get(player.getObjectId()) != relation))
          {
            player.sendPacket(new RelationChanged((L2PcInstance) this, relation, player.isAutoAttackable(this)));
          }
        }
        // if(Config.DEVELOPER && !isInsideRadius(player, 3500, false, false)) _log.warning("broadcastPacket: Too far player see event!");
      }
      catch (NullPointerException e)
View Full Code Here

        if ((mov instanceof CharInfo) && (this instanceof L2PcInstance))
        {
          int relation = ((L2PcInstance) this).getRelation(player);
          if ((getKnownList().getKnownRelations().get(player.getObjectId()) != null) && (getKnownList().getKnownRelations().get(player.getObjectId()) != relation))
          {
            player.sendPacket(new RelationChanged((L2PcInstance) this, relation, player.isAutoAttackable(this)));
          }
        }
      }
      catch (NullPointerException e)
      {
View Full Code Here

    player.setPvpFlag(value);
   
    player.sendPacket(new UserInfo(player));
    for (L2PcInstance target : getKnownList().getKnownPlayers().values())
    {
      target.sendPacket(new RelationChanged(player, player.getRelation(player), player.isAutoAttackable(target)));
    }
  }
View Full Code Here

             {
                 if (clear) member.setSiegeState((byte)0);
                 else member.setSiegeState((byte)1);
                 member.sendPacket(new UserInfo(member));
                 for (L2PcInstance player : member.getKnownList().getKnownPlayers().values()) {
              player.sendPacket(new RelationChanged(member, member.getRelation(player), member.isAutoAttackable(player)));
                 }
             }
        }
      for(L2SiegeClan siegeclan : getDefenderClans())
        {
            clan = ClanTable.getInstance().getClan(siegeclan.getClanId());
            for (L2PcInstance member : clan.getOnlineMembers(""))
            {
                if (clear) member.setSiegeState((byte)0);
                else member.setSiegeState((byte)2);
                member.sendPacket(new UserInfo(member));
                for (L2PcInstance player : member.getKnownList().getKnownPlayers().values()) {
              player.sendPacket(new RelationChanged(member, member.getRelation(player), member.isAutoAttackable(player)));
                }
            }
        }
    }
View Full Code Here

          {
            otherPlayer.getPosition().setWorldPosition(otherPlayer.getBoat().getPosition().getWorldPosition());
            _activeChar.sendPacket(new CharInfo(otherPlayer));
            int relation = otherPlayer.getRelation(_activeChar);
            if (otherPlayer.getKnownList().getKnownRelations().get(_activeChar.getObjectId()) != null && otherPlayer.getKnownList().getKnownRelations().get(_activeChar.getObjectId()) != relation)
              _activeChar.sendPacket(new RelationChanged(otherPlayer, relation, _activeChar.isAutoAttackable(otherPlayer)));
            _activeChar.sendPacket(new GetOnVehicle(otherPlayer, otherPlayer.getBoat(), otherPlayer.getInBoatPosition().getX(), otherPlayer.getInBoatPosition().getY(), otherPlayer.getInBoatPosition().getZ()));
          }
          else
          {
            _activeChar.sendPacket(new CharInfo(otherPlayer));
            int relation = otherPlayer.getRelation(_activeChar);
            if (otherPlayer.getKnownList().getKnownRelations().get(_activeChar.getObjectId()) != null && otherPlayer.getKnownList().getKnownRelations().get(_activeChar.getObjectId()) != relation)
              _activeChar.sendPacket(new RelationChanged(otherPlayer, relation, _activeChar.isAutoAttackable(otherPlayer)));
          }
        }

               if (object instanceof L2Character)
        {
View Full Code Here

  public void setKarmaFlag(int flag)
  {
    sendPacket(new UserInfo(this));
    for (L2PcInstance player : getKnownList().getKnownPlayers().values())
    {
      player.sendPacket(new RelationChanged(this, getRelation(player), isAutoAttackable(player)));
    }
  }
View Full Code Here

  public void broadcastKarma()
  {
    sendPacket(new UserInfo(this));
    for (L2PcInstance player : getKnownList().getKnownPlayers().values())
    {
      player.sendPacket(new RelationChanged(this, getRelation(player), isAutoAttackable(player)));
    }
  }
View Full Code Here

TOP

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

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.