Package lineage2.gameserver.network.serverpackets

Examples of lineage2.gameserver.network.serverpackets.SystemMessage2


      long total = SafeMath.mulAndCheck(price, count);
      long fee = Math.round(SafeMath.mulAndCheck(total, days) * REGISTRATION_FEE);
      fee = Math.max(fee, MIN_FEE);
      if ((fee > player.getAdena()) || !player.reduceAdena(fee, false))
      {
        player.sendPacket(new SystemMessage2(SystemMsg.YOU_DO_NOT_HAVE_ENOUGH_ADENA_TO_REGISTER_THE_ITEM));
        return;
      }
      ItemInstance cItem = inventory.removeItemByObjectId(objectId, count);
      container.addItem(cItem);
      String item_type = cItem.getTemplate().getExItemType().name();
View Full Code Here


    inventory.writeLock();
    try
    {
      if (itemInfo.getItem().getOwnerId() != player.getObjectId())
      {
        player.sendPacket(new SystemMessage2(SystemMsg.ITEM_PURCHASE_HAS_FAILED));
        return;
      }
      if (!CommissionShopDAO.getInstance().removeItem(auctionId))
      {
        return;
View Full Code Here

    inventory.writeLock();
    try
    {
      if (itemInfo.getItem().getOwnerId() == player.getObjectId())
      {
        player.sendPacket(new SystemMessage2(SystemMsg.ITEM_PURCHASE_HAS_FAILED));
        player.sendPacket(ExResponseCommissionBuyItem.FAILED);
        return;
      }
      if (!inventory.validateCapacity(itemInfo.getItem()) || !inventory.validateWeight(itemInfo.getItem()))
      {
View Full Code Here

    for (int shotId : player.getAutoSoulShot())
    {
      player.sendPacket(new ExAutoSoulShot(shotId, true));
    }
    player.sendPacket(new InventoryUpdate().addNewItem(item));
    player.sendPacket(new SystemMessage2(SystemMsg.YOU_HAVE_EQUIPPED_YOUR_S1).addItemNameWithAugmentation(item));
    player.getInventory().equipItem(item);
  }
View Full Code Here

      siegeEvent.addObject(SiegeEvent.ATTACKERS, siegeClan);
      SiegeClanDAO.getInstance().insert(fortress, siegeClan);
     
      siegeEvent.reCalcNextTime(false);
     
      player.sendPacket(new SystemMessage2(SystemMsg.YOUR_CLAN_HAS_BEEN_REGISTERED_TO_S1S_FORTRESS_BATTLE).addResidenceName(fortress));
      showChatWindow(player, "residence2/fortress/fortress_ordery005.htm");
    }
    else if (command.equalsIgnoreCase("cancel"))
    {
      Clan clan = player.getClan();
View Full Code Here

      activeChar.sendPacket(SystemMsg.YOU_MAY_NOT_EQUIP_A_PET_ITEM);
      return;
    }
    if (Config.ALT_IMPROVED_PETS_LIMITED_USE && activeChar.isMageClass() && (item.getItemId() == 10311))
    {
      activeChar.sendPacket(new SystemMessage2(SystemMsg.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS).addItemName(itemId));
      return;
    }
    if (Config.ALT_IMPROVED_PETS_LIMITED_USE && !activeChar.isMageClass() && (item.getItemId() == 10313))
    {
      activeChar.sendPacket(new SystemMessage2(SystemMsg.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS).addItemName(itemId));
      return;
    }
    if (activeChar.isOutOfControl())
    {
      activeChar.sendActionFailed();
View Full Code Here

      activeChar.sendMessage("A clan leader may not be dismissed.");
      return;
    }
    int subUnitType = activeChar.getPledgeType();
    clan.removeClanMember(subUnitType, activeChar.getObjectId());
    clan.broadcastToOnlineMembers(new SystemMessage2(SystemMsg.S1_HAS_WITHDRAWN_FROM_THE_CLAN).addString(activeChar.getName()), new PledgeShowMemberListDelete(activeChar.getName()));
    if (subUnitType == Clan.SUBUNIT_ACADEMY)
    {
      activeChar.setLvlJoinedAcademy(0);
    }
    activeChar.setClan(null);
View Full Code Here

        {
          requestor.sendPacket(SystemMsg.THE_OPPOSING_PARTY_HAS_DECLINED_YOUR_CHALLENGE_TO_A_DUEL);
        }
        else
        {
          requestor.sendPacket(new SystemMessage2(SystemMsg.C1_HAS_DECLINED_YOUR_CHALLENGE_TO_A_PARTY_DUEL).addName(activeChar));
        }
        break;
      case -1:
        request.cancel();
        requestor.sendPacket(new SystemMessage2(SystemMsg.C1_IS_SET_TO_REFUSE_DUEL_REQUESTS_AND_CANNOT_RECEIVE_A_DUEL_REQUEST).addName(activeChar));
        break;
      case 1:
        if (!duelEvent.canDuel(requestor, activeChar, false))
        {
          request.cancel();
          return;
        }
        SystemMessage2 msg1,
        msg2;
        if (_duelType == 1)
        {
          msg1 = new SystemMessage2(SystemMsg.YOU_HAVE_ACCEPTED_C1S_CHALLENGE_TO_A_PARTY_DUEL);
          msg2 = new SystemMessage2(SystemMsg.S1_HAS_ACCEPTED_YOUR_CHALLENGE_TO_DUEL_AGAINST_THEIR_PARTY);
        }
        else
        {
          msg1 = new SystemMessage2(SystemMsg.YOU_HAVE_ACCEPTED_C1S_CHALLENGE_A_DUEL);
          msg2 = new SystemMessage2(SystemMsg.C1_HAS_ACCEPTED_YOUR_CHALLENGE_TO_A_DUEL);
        }
        activeChar.sendPacket(msg1.addName(requestor));
        requestor.sendPacket(msg2.addName(activeChar));
        try
        {
          duelEvent.createDuel(requestor, activeChar);
        }
View Full Code Here

      player.sendPacket(new ExConfirmAddingPostFriend(_name, ExConfirmAddingPostFriend.ALREADY_ADDED));
      return;
    }
    CharacterPostFriendDAO.getInstance().insert(player, targetObjectId);
    postFriend.put(targetObjectId, CharacterDAO.getInstance().getNameByObjectId(targetObjectId));
    player.sendPacket(new SystemMessage2(SystemMsg.S1_WAS_SUCCESSFULLY_ADDED_TO_YOUR_CONTACT_LIST).addString(_name), new ExConfirmAddingPostFriend(_name, ExConfirmAddingPostFriend.SUCCESS));
  }
View Full Code Here

      return false;
    }
    final List<SkillLearn> list = SkillAcquireHolder.getInstance().getSkillLearnListByItemId(player, item.getItemId());
    if (list.isEmpty())
    {
      player.sendPacket(new SystemMessage2(SystemMsg.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS).addItemName(item.getItemId()));
      return false;
    }
    boolean alreadyHas = true;
    for (SkillLearn learn : list)
    {
      if (player.getSkillLevel(learn.getId()) != learn.getLevel())
      {
        alreadyHas = false;
        break;
      }
    }
    if (alreadyHas)
    {
      player.sendPacket(new SystemMessage2(SystemMsg.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS).addItemName(item.getItemId()));
      return false;
    }
    boolean wrongLvl = false;
    for (SkillLearn learn : list)
    {
      if (player.getLevel() < learn.getMinLevel())
      {
        wrongLvl = true;
      }
    }
    if (wrongLvl)
    {
      player.sendPacket(new SystemMessage2(SystemMsg.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS).addItemName(item.getItemId()));
      return false;
    }
    if (!player.consumeItem(item.getItemId(), 1L))
    {
      return false;
    }
    for (SkillLearn skillLearn : list)
    {
      Skill skill = SkillTable.getInstance().getInfo(skillLearn.getId(), skillLearn.getLevel());
      if (skill == null)
      {
        continue;
      }
      player.sendPacket(new SystemMessage2(SystemMsg.YOU_HAVE_EARNED_S1_SKILL).addSkillName(skill.getId(), skill.getLevel()));
      player.addSkill(skill, true);
    }
    player.updateStats();
    player.sendPacket(new SkillList(player));
    player.broadcastPacket(new MagicSkillUse(player, player, 2790, 1, 1, 0));
View Full Code Here

TOP

Related Classes of lineage2.gameserver.network.serverpackets.SystemMessage2

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.