Package lineage2.gameserver.network.serverpackets

Examples of lineage2.gameserver.network.serverpackets.InventoryUpdate


      if (equipped)
      {
        activeChar.getInventory().equipItem(itemToEnchant);
        activeChar.getInventory().isRefresh = false;
      }
      activeChar.sendPacket(new InventoryUpdate().addModifiedItem(itemToEnchant));
      activeChar.sendPacket(new ExAttributeEnchantResult(value));
    }
    else
    {
      activeChar.sendPacket(Msg.YOU_HAVE_FAILED_TO_ADD_ELEMENTAL_POWER);
View Full Code Here


        if (equipped)
        {
          inventory.equipItem(item);
          inventory.isRefresh = false;
        }
        player.sendPacket(new InventoryUpdate().addModifiedItem(item));

        if (item.isArmor())
          WorldStatisticsManager.getInstance().updateStat(player, CategoryType.ARMOR_ENCHANT_MAX, item.getCrystalType().ordinal(), item.getEnchantLevel());

        if (item.isWeapon())

          WorldStatisticsManager.getInstance().updateStat(player, CategoryType.WEAPON_ENCHANT_MAX, item.getCrystalType().ordinal(), item.getEnchantLevel());

        player.sendPacket(new EnchantResult(0, 0, 0L, item.getEnchantLevel()));

        if (Config.SHOW_ENCHANT_EFFECT_RESULT)
        {
          player.broadcastPacket(new L2GameServerPacket[] { new SystemMessage(3013).addName(player).addNumber(item.getEnchantLevel()).addItemName(item.getItemId()) });
          player.broadcastPacket(new L2GameServerPacket[] { new MagicSkillUse(player, player, 5965, 1, 500, 1500L) });
        }
      }
      else
      {
        switch (esi.getType())
        {
          case NORMAL:
            if (item.isEquipped())
            {
              player.sendDisarmMessage(item);
            }
            if (!inventory.destroyItem(item, 1L))
            {
              player.sendActionFailed();
              return;
            }
            int crystalId = item.getCrystalType().cry;
            if ((crystalId > 0) && (item.getTemplate().getCrystalCount() > 0))
            {
              int crystalAmount = (int) (item.getTemplate().getCrystalCount() * 0.87D);
              if (item.getEnchantLevel() > 3)
              {
                crystalAmount = (int) (crystalAmount + (item.getTemplate().getCrystalCount() * 0.25D * (item.getEnchantLevel() - 3)));
              }
              if (crystalAmount < 1)
              {
                crystalAmount = 1;
              }
              player.sendPacket(new EnchantResult(1, crystalId, crystalAmount));
              ItemFunctions.addItem(player, crystalId, crystalAmount, true);
            }
            else
            {
              player.sendPacket(EnchantResult.FAILED_NO_CRYSTALS);
            }
            break;
          case DESTRUCTION:
            item.setEnchantLevel(item.getEnchantLevel());
            item.setJdbcState(JdbcEntityState.UPDATED);
            item.update();
            if (equipped)
            {
              inventory.equipItem(item);
              inventory.isRefresh = false;
            }
            player.sendPacket(new InventoryUpdate().addModifiedItem(item));
            player.sendPacket(SystemMsg.THE_BLESSED_ENCHANT_FAILED);
            player.sendPacket(EnchantResult.ANCIENT_FAILED);
            break;
          case BLESSED:
          case ITEM_MALL:
          case CRYSTALL:
            item.setEnchantLevel(0);
            item.setJdbcState(JdbcEntityState.UPDATED);
            item.update();
            if (equipped)
            {
              inventory.equipItem(item);
              inventory.isRefresh = false;
            }
            player.sendPacket(new InventoryUpdate().addModifiedItem(item));
            player.sendPacket(SystemMsg.THE_BLESSED_ENCHANT_FAILED);
            player.sendPacket(EnchantResult.BLESSED_FAILED);
            break;
          case ANCIENT:
            player.sendPacket(EnchantResult.ANCIENT_FAILED);
View Full Code Here

  public void onShutdown()
  {}
 
  public void broadcastPacket(int value, boolean b)
  {
    L2GameServerPacket trigger = new EventTrigger(value, b);
    for (Player player : GameObjectsStorage.getAllPlayersForIterate())
      player.sendPacket(trigger);

  }
View Full Code Here

  }
 
  public void broadcastSend(Castle castle)
  {
    L2GameServerPacket trigger = new ExCastleState(castle);
    for (Player player : GameObjectsStorage.getAllPlayersForIterate())
      player.sendPacket(trigger);

  }
View Full Code Here

  {
    if (npcId != actor.getDisplayId())
    {
      actor.setDisplayId(npcId);
      DeleteObject d = new DeleteObject(actor);
      L2GameServerPacket su = new StatusUpdate(actor).addAttribute(StatusUpdateField.CUR_HP, StatusUpdateField.MAX_HP);
      for (Player player : World.getAroundPlayers(actor))
      {
        player.sendPacket(d, new NpcInfo(actor, player));
        if (player.getTarget() == actor)
        {
View Full Code Here

        effect.get(0).exit();
      }
      skill.getEffects(actor, player, false, false);
      if (animation)
      {
        actor.broadcastPacket(new MagicSkillUse(actor, player, skill.getId(), skill.getLevel(), skill.getHitTime(), 0));
      }
    }
  }
View Full Code Here

      actor.setDisplayId(npcId);
      DeleteObject d = new DeleteObject(actor);
      L2GameServerPacket su = new StatusUpdate(actor).addAttribute(StatusUpdateField.CUR_HP, StatusUpdateField.MAX_HP);
      for (Player player : World.getAroundPlayers(actor))
      {
        player.sendPacket(d, new NpcInfo(actor, player));
        if (player.getTarget() == actor)
        {
          player.setTarget(null);
          player.setTarget(actor);
          player.sendPacket(su);
View Full Code Here

   */
  @Override
  protected void onEvtDead(Creature killer)
  {
    final NpcInstance actor = getActor();
    actor.broadcastPacket(new PlaySound(PlaySound.Type.MUSIC, "BS02_D", 1, 0, actor.getLoc()));
    Functions.npcSay(actor, "A fatal error has occurred");
    Functions.npcSay(actor, "System is being shut down...");
    Functions.npcSay(actor, "......");
    try
    {
View Full Code Here

  {
    if (npcId != actor.getDisplayId())
    {
      actor.setDisplayId(npcId);
      DeleteObject d = new DeleteObject(actor);
      L2GameServerPacket su = new StatusUpdate(actor).addAttribute(StatusUpdateField.CUR_HP, StatusUpdateField.MAX_HP);
      for (Player player : World.getAroundPlayers(actor))
      {
        player.sendPacket(d, new NpcInfo(actor, player));
        if (player.getTarget() == actor)
        {
View Full Code Here

          break;
        case 30:
        case 20:
        case 10:
        case 5:
          Announcements.getInstance().announceToAll(new SystemMessage(SystemMessage.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECONDS__PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT).addNumber(shutdownCounter));
          break;
        case 0:
          switch (shutdownMode)
          {
            case SHUTDOWN:
View Full Code Here

TOP

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

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.