Package lineage2.gameserver.network.serverpackets

Examples of lineage2.gameserver.network.serverpackets.RecipeItemMakeInfo


  {
    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

   * Method updateEffectIconsImpl.
   */
  public void updateEffectIconsImpl()
  {
    Player owner = getPlayer();
    PartySpelled ps = new PartySpelled(this, true);
    Party party = owner.getParty();
    if (party != null)
    {
      party.broadCast(ps);
    }
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

      activeChar.sendPacket(SystemMsg.THE_RECIPE_IS_INCORRECT);
      return;
    }
    if (activeChar.getCurrentMp() < recipe.getMpConsume())
    {
      activeChar.sendPacket(SystemMsg.NOT_ENOUGH_MP, new RecipeItemMakeInfo(activeChar, recipe, 0));
      return;
    }
    if (!activeChar.findRecipe(_recipeId))
    {
      activeChar.sendPacket(SystemMsg.PLEASE_REGISTER_A_RECIPE, ActionFail.STATIC);
      return;
    }
    activeChar.getInventory().writeLock();
    try
    {
      RecipeComponent[] materials = recipe.getMaterials();
      for (RecipeComponent material : materials)
      {
        if (material.getCount() == 0)
        {
          continue;
        }
        if (Config.ALT_GAME_UNREGISTER_RECIPE && (ItemHolder.getInstance().getTemplate(material.getItemId()).getItemType() == EtcItemType.RECIPE))
        {
          RecipeTemplate rp = RecipeHolder.getInstance().getRecipeByRecipeItem(material.getItemId());
          if (activeChar.hasRecipe(rp))
          {
            continue;
          }
          activeChar.sendPacket(SystemMsg.YOU_DO_NOT_HAVE_ENOUGH_MATERIALS_TO_PERFORM_THAT_ACTION, new RecipeItemMakeInfo(activeChar, recipe, 0));
          return;
        }
        ItemInstance item = activeChar.getInventory().getItemByItemId(material.getItemId());
        if ((item == null) || (item.getCount() < material.getCount()))
        {
          activeChar.sendPacket(SystemMsg.YOU_DO_NOT_HAVE_ENOUGH_MATERIALS_TO_PERFORM_THAT_ACTION, new RecipeItemMakeInfo(activeChar, recipe, 0));
          return;
        }
      }
      for (RecipeComponent material : materials)
      {
        if (material.getCount() == 0)
        {
          continue;
        }
        if (Config.ALT_GAME_UNREGISTER_RECIPE && (ItemHolder.getInstance().getTemplate(material.getItemId()).getItemType() == EtcItemType.RECIPE))
        {
          activeChar.unregisterRecipe(RecipeHolder.getInstance().getRecipeByRecipeItem(material.getItemId()).getId());
        }
        else
        {
          if (!activeChar.getInventory().destroyItemByItemId(material.getItemId(), material.getCount()))
          {
            continue;
          }
          activeChar.sendPacket(SystemMessage2.removeItems(material.getItemId(), material.getCount()));
        }
      }
    }
    finally
    {
      activeChar.getInventory().writeUnlock();
    }
    activeChar.resetWaitSitTime();
    activeChar.reduceCurrentMp(recipe.getMpConsume(), null);
    RecipeComponent product = recipe.getRandomProduct();
    int itemId = product.getItemId();
    long itemsCount = product.getCount();
    int success = 0;
    if (Rnd.chance(recipe.getSuccessRate()))
    {
      ItemFunctions.addItem(activeChar, itemId, itemsCount, true);
      success = 1;
    }
    else
    {
      activeChar.sendPacket(new SystemMessage(SystemMessage.S1_MANUFACTURING_FAILURE).addItemName(itemId));
    }
    activeChar.sendPacket(new RecipeItemMakeInfo(activeChar, recipe, success));
  }
View Full Code Here

    if (recipeList == null)
    {
      activeChar.sendActionFailed();
      return;
    }
    sendPacket(new RecipeItemMakeInfo(activeChar, recipeList, 0xffffffff));
  }
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

            spawnRoom(7);
            setReenterTime(System.currentTimeMillis());
            for(Player p : getPlayers())
            {
              p.sendPacket(new ExSendUIEvent(p, 1, 1, 0, 0));
              p.sendPacket(new SystemMessage(SystemMessage.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTES).addNumber(5));
            }
            startCollapseTimer(5 * 60 * 1000L);
            timeSpent = (int) (System.currentTimeMillis() - _savedTime) / 1000;
          }
        }, 10000L);
View Full Code Here

TOP

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

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.