Package lineage2.gameserver.network.serverpackets.components

Examples of lineage2.gameserver.network.serverpackets.components.CustomMessage


   */
  public boolean goToLove(Player activeChar)
  {
    if (!activeChar.isMaried())
    {
      activeChar.sendMessage(new CustomMessage("voicedcommandhandlers.Wedding.YoureNotMarried", activeChar));
      return false;
    }
    if (activeChar.getPartnerId() == 0)
    {
      activeChar.sendMessage(new CustomMessage("voicedcommandhandlers.Wedding.PartnerNotInDB", activeChar));
      return false;
    }
    Player partner = GameObjectsStorage.getPlayer(activeChar.getPartnerId());
    if (partner == null)
    {
      activeChar.sendMessage(new CustomMessage("voicedcommandhandlers.Wedding.PartnerOffline", activeChar));
      return false;
    }
    if (partner.isInOlympiadMode() || activeChar.isMovementDisabled() || activeChar.isMuted(null) || activeChar.isInOlympiadMode() || activeChar.isInDuel() || activeChar.getPlayer().isTerritoryFlagEquipped() || partner.isInZone(no_summon))
    {
      activeChar.sendMessage(new CustomMessage("common.TryLater", activeChar));
      return false;
    }
    if ((activeChar.getTeleMode() != 0) || (activeChar.getReflection() != ReflectionManager.DEFAULT))
    {
      activeChar.sendMessage(new CustomMessage("common.TryLater", activeChar));
      return false;
    }
    if (partner.isInZoneBattle() || partner.isInZone(Zone.ZoneType.SIEGE) || partner.isInZone(no_restart) || partner.isInOlympiadMode() || activeChar.isInZoneBattle() || activeChar.isInZone(Zone.ZoneType.SIEGE) || activeChar.isInZone(no_restart) || activeChar.isInOlympiadMode() || (partner.getReflection() != ReflectionManager.DEFAULT) || partner.isInZone(no_summon) || activeChar.isInObserverMode() || partner.isInObserverMode())
    {
      activeChar.sendPacket(Msg.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING);
      return false;
    }
    if (!activeChar.reduceAdena(Config.WEDDING_TELEPORT_PRICE, true))
    {
      activeChar.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_ADENA);
      return false;
    }
    int teleportTimer = Config.WEDDING_TELEPORT_INTERVAL;
    activeChar.abortAttack(true, true);
    activeChar.abortCast(true, true);
    activeChar.sendActionFailed();
    activeChar.stopMove();
    activeChar.startParalyzed();
    activeChar.sendMessage(new CustomMessage("voicedcommandhandlers.Wedding.Teleport", activeChar).addNumber(teleportTimer / 60));
    activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
    activeChar.broadcastPacket(new MagicSkillUse(activeChar, activeChar, 1050, 1, teleportTimer, 0));
    activeChar.sendPacket(new SetupGauge(activeChar, SetupGauge.BLUE_DUAL, teleportTimer));
    ThreadPoolManager.getInstance().schedule(new EscapeFinalizer(activeChar, partner.getLoc()), teleportTimer * 1000L);
    return true;
View Full Code Here


      if (((player1 = _playerRef1.get()) == null) || ((player2 = _playerRef2.get()) == null))
      {
        return;
      }
      CoupleManager.getInstance().createCouple(player1, player2);
      player1.sendMessage(new CustomMessage("lineage2.gameserver.model.L2Player.EngageAnswerYes", player2));
    }
View Full Code Here

      Player player1, player2;
      if (((player1 = _playerRef1.get()) == null) || ((player2 = _playerRef2.get()) == null))
      {
        return;
      }
      player1.sendMessage(new CustomMessage("lineage2.gameserver.model.L2Player.EngageAnswerNo", player2));
    }
View Full Code Here

  private boolean check(String command, Player activeChar, String target)
  {
    String[] parts = target.split(" ");
    if (parts.length != 3)
    {
      show(new CustomMessage("scripts.commands.user.password.IncorrectValues", activeChar), activeChar);
      return false;
    }
    if (!parts[1].equals(parts[2]))
    {
      show(new CustomMessage("scripts.commands.user.password.IncorrectConfirmation", activeChar), activeChar);
      return false;
    }
    if (parts[1].equals(parts[0]))
    {
      show(new CustomMessage("scripts.commands.user.password.NewPassIsOldPass", activeChar), activeChar);
      return false;
    }
    if ((parts[1].length() < 5) || (parts[1].length() > 20))
    {
      show(new CustomMessage("scripts.commands.user.password.IncorrectSize", activeChar), activeChar);
      return false;
    }
    LoginServerCommunication.getInstance().sendPacket(new ChangePassword(activeChar.getAccountName(), parts[0], parts[1], "null"));
    show(new CustomMessage("scripts.commands.user.password.ResultTrue", activeChar), activeChar);
    return true;
  }
View Full Code Here

      return false;
    }
    if (player.isDebug())
    {
      player.setDebug(false);
      player.sendMessage(new CustomMessage("voicedcommandhandlers.Debug.Disabled", player));
    }
    else
    {
      player.setDebug(true);
      player.sendMessage(new CustomMessage("voicedcommandhandlers.Debug.Enabled", player));
    }
    return true;
  }
View Full Code Here

   */
  private boolean exp(String command, Player activeChar, String args)
  {
    if (activeChar.getLevel() >= (activeChar.isBaseClassActive() ? Experience.getMaxSubLevel() : Experience.getMaxLevel()))
    {
      activeChar.sendMessage(new CustomMessage("voicedcommandhandlers.Help.MaxLevel", activeChar));
    }
    else
    {
      long exp = Experience.LEVEL[activeChar.getLevel() + 1] - activeChar.getExp();
      activeChar.sendMessage(new CustomMessage("voicedcommandhandlers.Help.ExpLeft", activeChar).addNumber(exp));
    }
    return true;
  }
View Full Code Here

        setJdbcState(JdbcEntityState.UPDATED);
        update();

        if (activeChar != null)
            activeChar.sendMessage(new CustomMessage("lineage2.gameserver.model.entity.Castle.OutOfControl.CastleTaxChangetTo", activeChar).addString(getName()).addNumber(taxPercent));
    }
View Full Code Here

     
      if ((tax > 0) && !notax)
      {
        if (castle != null)
        {
          activeChar.sendMessage(new CustomMessage("trade.HavePaidTax", activeChar).addNumber(tax));
          if ((merchant != null) && (merchant.getReflection() == ReflectionManager.DEFAULT))
          {
            castle.addToTreasury(tax, true, false);
          }
        }
View Full Code Here

  {
    if (!target.isEmpty())
    {
      if (activeChar.getName().equalsIgnoreCase(target))
      {
        sendMessage(new CustomMessage("voicedcommandhandlers.Repair.YouCantRepairYourself", activeChar), activeChar);
        return false;
      }
      int objId = 0;
      for (Map.Entry<Integer, String> e : activeChar.getAccountChars().entrySet())
      {
        if (e.getValue().equalsIgnoreCase(target))
        {
          objId = e.getKey();
          break;
        }
      }
      if (objId == 0)
      {
        sendMessage(new CustomMessage("voicedcommandhandlers.Repair.YouCanRepairOnlyOnSameAccount", activeChar), activeChar);
        return false;
      }
      else if (World.getPlayer(objId) != null)
      {
        sendMessage(new CustomMessage("voicedcommandhandlers.Repair.CharIsOnline", activeChar), activeChar);
        return false;
      }
      Connection con = null;
      PreparedStatement statement = null;
      PreparedStatement statement2 = null;
      ResultSet rs = null;
      try
      {
        con = DatabaseFactory.getInstance().getConnection();
        statement = con.prepareStatement("SELECT karma FROM characters WHERE obj_Id=?");
        statement.setInt(1, objId);
        statement.execute();
        rs = statement.getResultSet();
        int karma = 0;
        rs.next();
        karma = rs.getInt("karma");
        DbUtils.close(statement, rs);
        if (karma > 0)
        {
          statement = con.prepareStatement("UPDATE characters SET x=17144, y=170156, z=-3502 WHERE obj_Id=?");
          statement.setInt(1, objId);
          statement.execute();
          DbUtils.close(statement);
        }
        else
        {
          statement2 = con.prepareStatement("UPDATE characters SET x=0, y=0, z=0 WHERE obj_Id=?");
          statement2.setInt(1, objId);
          statement2.execute();
          DbUtils.close(statement2);
          Collection<ItemInstance> items = ItemsDAO.getInstance().getItemsByOwnerIdAndLoc(objId, ItemLocation.PAPERDOLL);
          for (ItemInstance item : items)
          {
            item.setEquipped(false);
            item.setLocData(0);
            item.setLocation(ItemLocation.WAREHOUSE);
            item.setJdbcState(JdbcEntityState.UPDATED);
            item.update();
          }
        }
        statement = con.prepareStatement("DELETE FROM character_variables WHERE obj_id=? AND type='user-var' AND name='reflection'");
        statement.setInt(1, objId);
        statement.execute();
        DbUtils.close(statement);
        sendMessage(new CustomMessage("voicedcommandhandlers.Repair.RepairDone", activeChar), activeChar);
        return true;
      }
      catch (Exception e)
      {
        _log.error("", e);
View Full Code Here

      activeChar.sendActionFailed();
      return false;
    }
    if (activeChar.getLevel() < Config.SERVICES_OFFLINE_TRADE_MIN_LEVEL)
    {
      show(new CustomMessage("voicedcommandhandlers.Offline.LowLevel", activeChar).addNumber(Config.SERVICES_OFFLINE_TRADE_MIN_LEVEL), activeChar);
      return false;
    }
    if (!activeChar.isInZone(Zone.ZoneType.offshore) && Config.SERVICES_OFFLINE_TRADE_ALLOW_OFFSHORE)
    {
      show(new CustomMessage("trade.OfflineNoTradeZoneOnlyOffshore", activeChar), activeChar);
      return false;
    }
    if (!activeChar.isInStoreMode())
    {
      show(new CustomMessage("voicedcommandhandlers.Offline.IncorrectUse", activeChar), activeChar);
      return false;
    }
    if (activeChar.getNoChannelRemained() > 0)
    {
      show(new CustomMessage("voicedcommandhandlers.Offline.BanChat", activeChar), activeChar);
      return false;
    }
    if (activeChar.isActionBlocked(Zone.BLOCKED_ACTION_PRIVATE_STORE))
    {
      show(new CustomMessage("trade.OfflineNoTradeZone", activeChar), activeChar);
      return false;
    }
    if ((Config.SERVICES_OFFLINE_TRADE_PRICE > 0) && (Config.SERVICES_OFFLINE_TRADE_PRICE_ITEM > 0))
    {
      if (getItemCount(activeChar, Config.SERVICES_OFFLINE_TRADE_PRICE_ITEM) < Config.SERVICES_OFFLINE_TRADE_PRICE)
      {
        show(new CustomMessage("voicedcommandhandlers.Offline.NotEnough", activeChar).addItemName(Config.SERVICES_OFFLINE_TRADE_PRICE_ITEM).addNumber(Config.SERVICES_OFFLINE_TRADE_PRICE), activeChar);
        return false;
      }
      removeItem(activeChar, Config.SERVICES_OFFLINE_TRADE_PRICE_ITEM, Config.SERVICES_OFFLINE_TRADE_PRICE);
    }
    activeChar.offline();
View Full Code Here

TOP

Related Classes of lineage2.gameserver.network.serverpackets.components.CustomMessage

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.