Package net.sf.l2j.gameserver.serverpackets

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


              if (getActiveChar() instanceof L2PcInstance && ((L2PcInstance)getActiveChar()).isInDuel())
              {
                getActiveChar().disableAllSkills();
                stopHpMpRegeneration();
                 attacker.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
                 attacker.sendPacket(new ActionFailed());

                // let the DuelManager know of his defeat
                DuelManager.getInstance().onPlayerDefeat((L2PcInstance)getActiveChar());
                value = 1;
              }
View Full Code Here


        if (_clan.getLevel() < 3 || _clan.getMembersCount() < Config.ALT_CLAN_MEMBERS_FOR_WAR)
        {
            SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_WAR_DECLARED_IF_CLAN_LVL3_OR_15_MEMBER);
            player.sendPacket(sm);
            player.sendPacket(new ActionFailed());
            sm = null;
            return;
        }
        else if (!player.isClanLeader())
        {
            player.sendMessage("You can't declare war. You are not clan leader.");
            player.sendPacket(new ActionFailed());
            return;
        }

        L2Clan clan = ClanTable.getInstance().getClanByName(_pledgeName);
        if (clan == null)
        {
          SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_WAR_CANNOT_DECLARED_CLAN_NOT_EXIST);
            player.sendPacket(sm);
            player.sendPacket(new ActionFailed());
            return;
        }
        else if (_clan.getAllyId() == clan.getAllyId() && _clan.getAllyId() != 0)
        {
            SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_WAR_AGAINST_A_ALLIED_CLAN_NOT_WORK);
            player.sendPacket(sm);
            player.sendPacket(new ActionFailed());
            sm = null;
            return;
        }
        //else if(clan.getLevel() < 3)
        else if (clan.getLevel() < 3 || clan.getMembersCount() < Config.ALT_CLAN_MEMBERS_FOR_WAR)
        {
            SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_WAR_DECLARED_IF_CLAN_LVL3_OR_15_MEMBER);
            player.sendPacket(sm);
            player.sendPacket(new ActionFailed());
            sm = null;
            return;
        }
        else if (_clan.isAtWarWith(clan.getClanId()))
        {
            SystemMessage sm = new SystemMessage(SystemMessageId.ALREADY_AT_WAR_WITH_S1_WAIT_5_DAYS); //msg id 628
            sm.addString(clan.getName());
            player.sendPacket(sm);
            player.sendPacket(new ActionFailed());
            sm = null;
            return;
        }

        //_log.warning("RequestStartPledgeWar, leader: " + clan.getLeaderName() + " clan: "+ _clan.getName());
View Full Code Here

    else
      return;

    if (activeChar.isAllSkillsDisabled())
    {
      activeChar.sendPacket(new ActionFailed());
      return;
    }

    if (activeChar.isInOlympiadMode())
    {
View Full Code Here

        if (classid == 2 || classid == 48 || classid == 88 || classid == 114)
        {

          if (activeChar.isAllSkillsDisabled())
          {
            ActionFailed af = new ActionFailed();
            activeChar.sendPacket(af);
            return;
            }

            if (activeChar.isSitting())
View Full Code Here

        L2PcInstance activeChar = (L2PcInstance)playable;

        // Thanks nbd
        if (!TvTEvent.onEscapeUse(activeChar.getName()))
        {
          activeChar.sendPacket(new ActionFailed());
          return;
        }

        if (activeChar.isMovementDisabled() || activeChar.isMuted() || activeChar.isAlikeDead() || activeChar.isAllSkillsDisabled())
            return;
View Full Code Here

      NpcHtmlMessage itemReply = new NpcHtmlMessage(5);
      itemReply.setHtml(content);
      activeChar.sendPacket(itemReply);
    }

    activeChar.sendPacket( new ActionFailed() );
  }
View Full Code Here

      // Send a System Message to the caster
            SystemMessage sm = new SystemMessage(SystemMessageId.INCORRECT_TARGET);
      activeChar.sendPacket(sm);

      // Send a Server->Client packet ActionFailed to the L2PcInstance
            ActionFailed af = new ActionFailed();
            activeChar.sendPacket(af);

            return;
    }

        // u can use soul crystal only when target hp goes below 50%
        if(((L2MonsterInstance)target).getCurrentHp() > ((L2MonsterInstance)target).getMaxHp()/2.0)
        {
            ActionFailed af = new ActionFailed();
            activeChar.sendPacket(af);
            return;
        }

    int crystalId = item.getItemId();
View Full Code Here

    {
      SystemMessage sm = new SystemMessage(
          SystemMessageId.CRYSTALLIZE_LEVEL_TOO_LOW);
      activeChar.sendPacket(sm);
      sm = null;
      ActionFailed af = new ActionFailed();
      activeChar.sendPacket(af);
      return;
    }

    PcInventory inventory = activeChar.getInventory();
    if (inventory != null)
    {
      L2ItemInstance item = inventory.getItemByObjectId(_objectId);
      if (item == null || item.isWear())
      {
        ActionFailed af = new ActionFailed();
        activeChar.sendPacket(af);
        return;
      }

      int itemId = item.getItemId();
      if ((itemId >= 6611 && itemId <= 6621) || itemId == 6842)
        return;

      if (_count > item.getCount())
      {
        _count = activeChar.getInventory().getItemByObjectId(_objectId)
            .getCount();
      }
    }

    L2ItemInstance itemToRemove = activeChar.getInventory()
        .getItemByObjectId(_objectId);
    if (itemToRemove == null || itemToRemove.isWear())
    {
      return;
    }
    if (!itemToRemove.getItem().isCrystallizable()
        || (itemToRemove.getItem().getCrystalCount() <= 0)
        || (itemToRemove.getItem().getCrystalType() == L2Item.CRYSTAL_NONE))
    {
      _log.warning("" + activeChar.getObjectId()
          + " tried to crystallize "
          + itemToRemove.getItem().getItemId());
      return;
    }

    // Check if the char can crystallize C items and return if false;
    if (itemToRemove.getItem().getCrystalType() == L2Item.CRYSTAL_C
        && skillLevel <= 1)
    {
      SystemMessage sm = new SystemMessage(
          SystemMessageId.CRYSTALLIZE_LEVEL_TOO_LOW);
      activeChar.sendPacket(sm);
      sm = null;
      ActionFailed af = new ActionFailed();
      activeChar.sendPacket(af);
      return;
    }

    // Check if the user can crystallize B items and return if false;
    if (itemToRemove.getItem().getCrystalType() == L2Item.CRYSTAL_B
        && skillLevel <= 2)
    {
      SystemMessage sm = new SystemMessage(
          SystemMessageId.CRYSTALLIZE_LEVEL_TOO_LOW);
      activeChar.sendPacket(sm);
      sm = null;
      ActionFailed af = new ActionFailed();
      activeChar.sendPacket(af);
      return;
    }

    // Check if the user can crystallize A items and return if false;
    if (itemToRemove.getItem().getCrystalType() == L2Item.CRYSTAL_A
        && skillLevel <= 3)
    {
      SystemMessage sm = new SystemMessage(
          SystemMessageId.CRYSTALLIZE_LEVEL_TOO_LOW);
      activeChar.sendPacket(sm);
      sm = null;
      ActionFailed af = new ActionFailed();
      activeChar.sendPacket(af);
      return;
    }

    // Check if the user can crystallize S items and return if false;
    if (itemToRemove.getItem().getCrystalType() == L2Item.CRYSTAL_S
        && skillLevel <= 4)
    {
      SystemMessage sm = new SystemMessage(
          SystemMessageId.CRYSTALLIZE_LEVEL_TOO_LOW);
      activeChar.sendPacket(sm);
      sm = null;
      ActionFailed af = new ActionFailed();
      activeChar.sendPacket(af);
      return;
    }

    activeChar.setInCrystallize(true);
View Full Code Here

        return;

        // Player shouldn't be able to set stores if he/she is alike dead (dead or fake death)
        if (player.isAlikeDead())
        {
            sendPacket(new ActionFailed());
            return;
        }

  if (!(player.getTarget() instanceof L2PcInstance))
      return;
View Full Code Here

     * <FONT COLOR=#FF0000><B> <U>Caution</U> : Low level function, used by AI subclasses</B></FONT><BR><BR>
     *
     */
    protected void clientActionFailed()
    {
        if (_actor instanceof L2PcInstance) _actor.sendPacket(new ActionFailed());
    }
View Full Code Here

TOP

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

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.