Package lineage2.gameserver.network.serverpackets.components

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


    {
      return;
    }
    if (!Config.ALT_ALLOW_SHADOW_WEAPONS)
    {
      show(new CustomMessage("common.Disabled", player), player);
      return;
    }
    if ((player.getLevel() > 19) || (player.getClassLevel() > 1))
    {
      show("Your level is too high!", player);
View Full Code Here


    {
      return;
    }
    if (!Config.ALT_ALLOW_SHADOW_WEAPONS)
    {
      show(new CustomMessage("common.Disabled", player), player);
      return;
    }
    if ((player.getLevel() > 39) || (player.getClassLevel() > 2))
    {
      show("Your level is too high!", player);
View Full Code Here

      }
      if (cha.getLevel() > zone.getParams().getInteger("levelLimit"))
      {
        if (cha.isPlayer())
        {
          cha.getPlayer().sendMessage(new CustomMessage("scripts.zones.epic.banishMsg", (Player) cha));
        }
        cha.teleToLocation(Location.parseLoc(zone.getParams().getString("tele")));
      }
    }
View Full Code Here

      player.sendActionFailed();
      return;
    }
    if (player.isInObserverMode())
    {
      player.sendMessage(new CustomMessage("lineage2.gameserver.model.L2Playable.OutOfControl.ObserverNoAttack", player));
      return;
    }
    if (!checkTarget(target))
    {
      getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, null, null);
View Full Code Here

    {
      return false;
    }
    if ((activeChar.getTeleMode() != 0) || !activeChar.getPlayerAccess().UseTeleport)
    {
      activeChar.sendMessage(new CustomMessage("common.TryLater", activeChar));
      return false;
    }
    if (activeChar.isTerritoryFlagEquipped())
    {
      activeChar.sendPacket(Msg.YOU_CANNOT_TELEPORT_WHILE_IN_POSSESSION_OF_A_WARD);
      return false;
    }
    if (activeChar.isInDuel() || (activeChar.getTeam() != TeamType.NONE))
    {
      activeChar.sendMessage(new CustomMessage("common.RecallInDuel", activeChar));
      return false;
    }
    activeChar.abortAttack(true, true);
    activeChar.abortCast(true, true);
    activeChar.stopMove();
View Full Code Here

      case Party.ITEM_RANDOM_SPOIL:
        activeChar.sendPacket(Msg.LOOTING_METHOD_RANDOM_INCLUDING_SPOIL);
        break;
    }
    activeChar.sendPacket(new SystemMessage(SystemMessage.PARTY_LEADER_S1).addString(partyLeader.getName()));
    activeChar.sendMessage(new CustomMessage("scripts.commands.user.PartyInfo.Members", activeChar).addNumber(memberCount));
    activeChar.sendPacket(Msg.__DASHES__);
    return true;
  }
View Full Code Here

    }
    sm.addString(df.format(h)).addString(df.format(m));
    activeChar.sendPacket(sm);
    if (Config.ALT_SHOW_SERVER_TIME)
    {
      activeChar.sendMessage(new CustomMessage("usercommandhandlers.Time.ServerTime", activeChar, sf.format(new Date(System.currentTimeMillis()))));
    }
    return true;
  }
View Full Code Here

      return false;
    }
    switch (id)
    {
      case 92:
        activeChar.sendMessage(new CustomMessage("usercommandhandlers.CommandChannel", activeChar));
        break;
      case 93:
        if (!activeChar.isInParty() || !activeChar.getParty().isInCommandChannel())
        {
          return true;
View Full Code Here

    }
    int _partnerId = activeChar.getPartnerId();
    long AdenaAmount = 0;
    if (activeChar.isMaried())
    {
      activeChar.sendMessage(new CustomMessage("voicedcommandhandlers.Wedding.Divorced", activeChar));
      AdenaAmount = Math.abs(((activeChar.getAdena() / 100) * Config.WEDDING_DIVORCE_COSTS) - 10);
      activeChar.reduceAdena(AdenaAmount, true);
    }
    else
    {
      activeChar.sendMessage(new CustomMessage("voicedcommandhandlers.Wedding.Disengaged", activeChar));
    }
    activeChar.setMaried(false);
    activeChar.setPartnerId(0);
    Couple couple = CoupleManager.getInstance().getCouple(activeChar.getCoupleId());
    couple.divorce();
    couple = null;
    Player partner = GameObjectsStorage.getPlayer(_partnerId);
    if (partner != null)
    {
      partner.setPartnerId(0);
      if (partner.isMaried())
      {
        partner.sendMessage(new CustomMessage("voicedcommandhandlers.Wedding.PartnerDivorce", partner));
      }
      else
      {
        partner.sendMessage(new CustomMessage("voicedcommandhandlers.Wedding.PartnerDisengage", partner));
      }
      partner.setMaried(false);
      if (AdenaAmount > 0)
      {
        partner.addAdena(AdenaAmount);
View Full Code Here

   */
  public boolean engage(final Player activeChar)
  {
    if (activeChar.getTarget() == null)
    {
      activeChar.sendMessage(new CustomMessage("voicedcommandhandlers.Wedding.NoneTargeted", activeChar));
      return false;
    }
    if (!activeChar.getTarget().isPlayer())
    {
      activeChar.sendMessage(new CustomMessage("voicedcommandhandlers.Wedding.OnlyAnotherPlayer", activeChar));
      return false;
    }
    if (activeChar.getPartnerId() != 0)
    {
      activeChar.sendMessage(new CustomMessage("voicedcommandhandlers.Wedding.AlreadyEngaged", activeChar));
      if (Config.WEDDING_PUNISH_INFIDELITY)
      {
        activeChar.startAbnormalEffect(AbnormalEffect.BIG_HEAD);
        int skillId;
        int skillLevel = 1;
        if (activeChar.getLevel() > 40)
        {
          skillLevel = 2;
        }
        if (activeChar.isMageClass())
        {
          skillId = 4361;
        }
        else
        {
          skillId = 4362;
        }
        Skill skill = SkillTable.getInstance().getInfo(skillId, skillLevel);
        if (activeChar.getEffectList().getEffectsBySkill(skill) == null)
        {
          skill.getEffects(activeChar, activeChar, false, false);
          activeChar.sendPacket(new SystemMessage(SystemMessage.S1_S2S_EFFECT_CAN_BE_FELT).addSkillName(skillId, skillLevel));
        }
      }
      return false;
    }
    final Player ptarget = (Player) activeChar.getTarget();
    if (ptarget.getObjectId() == activeChar.getObjectId())
    {
      activeChar.sendMessage(new CustomMessage("voicedcommandhandlers.Wedding.EngagingYourself", activeChar));
      return false;
    }
    if (ptarget.isMaried())
    {
      activeChar.sendMessage(new CustomMessage("voicedcommandhandlers.Wedding.PlayerAlreadyMarried", activeChar));
      return false;
    }
    if (ptarget.getPartnerId() != 0)
    {
      activeChar.sendMessage(new CustomMessage("voicedcommandhandlers.Wedding.PlayerAlreadyEngaged", activeChar));
      return false;
    }
    Pair<Integer, OnAnswerListener> entry = ptarget.getAskListener(false);
    if ((entry != null) && (entry.getValue() instanceof CoupleAnswerListener))
    {
      activeChar.sendMessage(new CustomMessage("voicedcommandhandlers.Wedding.PlayerAlreadyAsked", activeChar));
      return false;
    }
    if (ptarget.getPartnerId() != 0)
    {
      activeChar.sendMessage(new CustomMessage("voicedcommandhandlers.Wedding.PlayerAlreadyEngaged", activeChar));
      return false;
    }
    if ((ptarget.getSex() == activeChar.getSex()) && !Config.WEDDING_SAMESEX)
    {
      activeChar.sendMessage(new CustomMessage("voicedcommandhandlers.Wedding.SameSex", activeChar));
      return false;
    }
    boolean FoundOnFriendList = false;
    int objectId;
    Connection con = null;
    PreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT friend_id FROM character_friends WHERE char_id=?");
      statement.setInt(1, ptarget.getObjectId());
      rset = statement.executeQuery();
      while (rset.next())
      {
        objectId = rset.getInt("friend_id");
        if (objectId == activeChar.getObjectId())
        {
          FoundOnFriendList = true;
          break;
        }
      }
    }
    catch (Exception e)
    {
      _log.error("", e);
    }
    finally
    {
      DbUtils.closeQuietly(con, statement, rset);
    }
    if (!FoundOnFriendList)
    {
      activeChar.sendMessage(new CustomMessage("voicedcommandhandlers.Wedding.NotInFriendlist", activeChar));
      return false;
    }
    ConfirmDlg packet = new ConfirmDlg(SystemMsg.S1, 60000).addString("Player " + activeChar.getName() + " asking you to engage. Do you want to start new relationship?");
    ptarget.ask(packet, new CoupleAnswerListener(activeChar, ptarget));
    return true;
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.