Package com.l2jfrozen.gameserver.network.serverpackets

Examples of com.l2jfrozen.gameserver.network.serverpackets.ActionFailed


    }
   
    if (player.isCastingNow())
    {
      player.abortCast();
      player.sendPacket(new ActionFailed());
    }
   
    RegionBBSManager.getInstance().changeCommunityBoard();
    player.deleteMe();
  }
View Full Code Here


    if(skillLevel <= 0)
    {
      SystemMessage sm = new SystemMessage(SystemMessageId.CRYSTALLIZE_LEVEL_TOO_LOW);
      activeChar.sendPacket(sm);
      sm = null;
      ActionFailed af = ActionFailed.STATIC_PACKET;
      activeChar.sendPacket(af);
      return;
    }

    PcInventory inventory = activeChar.getInventory();
    if(inventory != null)
    {
      L2ItemInstance item = inventory.getItemByObjectId(_objectId);
      if(item == null || item.isWear())
      {
        ActionFailed af = ActionFailed.STATIC_PACKET;
        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.fireEvent("CRYSTALLIZE", (Object[]) null) != null)
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.CANNOT_DISCARD_THIS_ITEM));
      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 = ActionFailed.STATIC_PACKET;
      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 = ActionFailed.STATIC_PACKET;
      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 = ActionFailed.STATIC_PACKET;
      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 = ActionFailed.STATIC_PACKET;
      activeChar.sendPacket(af);
      return;
    }

    activeChar.setInCrystallize(true);
View Full Code Here

    }
   
    // if(activeChar._inEventTvT && TvT._started && !Config.TVT_ALLOW_SUMMON)
    if (activeChar._inEventTvT && TvT.is_started() && !Config.TVT_ALLOW_SUMMON)
    {
      ActionFailed af = ActionFailed.STATIC_PACKET;
      activeChar.sendPacket(af);
      return;
    }
   
    // if(activeChar._inEventDM && DM._started && !Config.DM_ALLOW_SUMMON)
    if (activeChar._inEventDM && DM.is_started() && !Config.DM_ALLOW_SUMMON)
    {
      ActionFailed af = ActionFailed.STATIC_PACKET;
      activeChar.sendPacket(af);
      return;
    }
   
    // if(activeChar._inEventCTF && CTF._started && !Config.CTF_ALLOW_SUMMON)
    if (activeChar._inEventCTF && CTF.is_started() && !Config.CTF_ALLOW_SUMMON)
    {
      ActionFailed af = ActionFailed.STATIC_PACKET;
      activeChar.sendPacket(af);
      return;
    }
   
    if (activeChar.isSitting())
View Full Code Here

  /**
   * Stops all players from attacking. Used for duel timeout / interrupt.
   */
  private void stopFighting()
  {
    ActionFailed af = ActionFailed.STATIC_PACKET;
    if(_partyDuel)
    {
      for(L2PcInstance temp : _playerA.getParty().getPartyMembers())
      {
        temp.abortCast();
View Full Code Here

      {
        showChatWindow(player);
      }
    }
    // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
    player.sendPacket(new ActionFailed());
  }
View Full Code Here

          }
        }
        replyMSG.append("</table></center></body></html>");
        nhm.setHtml(replyMSG.toString());
        activeChar.sendPacket(nhm);
        activeChar.sendPacket(new ActionFailed());
      }
      else
      {
        activeChar.sendMessage("Siege is not currently in progress!");
      }
View Full Code Here

   
    // Fix against exploit anti-target
    if (player.isCastingNow())
    {
      player.abortCast();
      player.sendPacket(new ActionFailed());
    }

    // Check if player is teleporting
    if(player.isTeleporting())
    {
View Full Code Here

        // Notify the L2PcInstance AI with AI_INTENTION_INTERACT
        player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this);
      }
    }
    // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
    player.sendPacket(new ActionFailed());
  }
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.network.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.