Package l2p.gameserver.model.items

Examples of l2p.gameserver.model.items.L2ItemInstance$LazyUpdateInDb


          int id = Integer.parseInt(wordList[1]);
          int num = wordList.length > 2 ? Integer.parseInt(wordList[2]) : 1;
          long count = wordList.length > 3 ? Long.parseLong(wordList[3]) : 1;
          for(int i = 0; i < num; i++)
          {
            L2ItemInstance createditem = ItemTable.getInstance().createItem(id);
            createditem.setCount(count);
            createditem.dropToTheGround(activeChar, Rnd.coordsRandomize(activeChar, 100));
          }
        }
        catch(NumberFormatException nfe)
        {
          activeChar.sendMessage("Specify a valid number.");
View Full Code Here


    return Commands.values();
  }

  private void createItem(L2Player activeChar, L2Player player, int id, long num)
  {
    L2ItemInstance createditem = ItemTable.getInstance().createItem(id);
    createditem.setCount(num);
    activeChar.getInventory().addItem(createditem);
    Log.LogItem(activeChar, Log.Adm_AddItem, createditem);
    if(!createditem.isStackable())
    {
      for(long i = 0; i < num - 1; i++)
      {
        createditem = ItemTable.getInstance().createItem(id);
        activeChar.getInventory().addItem(createditem);
        Log.LogItem(activeChar, Log.Adm_AddItem, createditem);
      }
    }
    if (activeChar != player) player.sendMessage("Персонажу, " + activeChar.getName() + " было успешно добавленно " + num + " " + createditem.getName()+".")
    activeChar.sendPacket(new ItemList(activeChar, true), SystemMessage.obtainItems(id, num, 0));
  }
View Full Code Here

    if(player.getInventory().getItemByItemId((fwd ? GREAT_WOLF_NECKLACE : WHITE_WOLF_NECKLACE)) == null)
    {
      show(Files.read("data/scripts/services/petevolve/error_2.htm", player), player, npc);
      return;
    }
    L2ItemInstance control = player.getInventory().getItemByObjectId(player.getPet().getControlItemObjId());
    control.setItemId(fwd ? WHITE_WOLF_NECKLACE : GREAT_WOLF_NECKLACE);
    control.updateDatabase(true, true);
    player.sendPacket(new ItemList(player, false));
    player.getPet().unSummon();
    show(Files.read("data/scripts/services/petevolve/end_msg3_gwolf.htm", player), player, npc);
  }
View Full Code Here

    if(pl_pet.getLevel() < 70)
    {
      show(Files.read("data/scripts/services/petevolve/error_lvl_fenrir.htm", player), player, npc);
      return;
    }
    L2ItemInstance control = player.getInventory().getItemByObjectId(player.getPet().getControlItemObjId());
    control.setItemId(fwd ? WHITE_FENRIR_NECKLACE : FENRIR_NECKLACE);
    control.updateDatabase(true, true);
    player.sendPacket(new ItemList(player, false));
    player.getPet().unSummon();
    show(Files.read("data/scripts/services/petevolve/end_msg2_fenrir.htm", player), player, npc);
  }
View Full Code Here

    if(pl_pet.getLevel() < 70)
    {
      show(Files.read("data/scripts/services/petevolve/no_level_gw.htm", player), player, npc);
      return;
    }
    L2ItemInstance control = player.getInventory().getItemByObjectId(player.getPet().getControlItemObjId());
    control.setItemId(fwd ? WHITE_FENRIR_NECKLACE : WHITE_WOLF_NECKLACE);
    control.updateDatabase(true, true);
    player.sendPacket(new ItemList(player, false));
    player.getPet().unSummon();
    show(Files.read("data/scripts/services/petevolve/yes_wolf.htm", player), player, npc);
  }
View Full Code Here

    if(player.getInventory().getItemByItemId(fwd ? WIND_STRIDER_ITEM : RED_WS_ITEM) == null)
    {
      show(Files.read("data/scripts/services/petevolve/error_2.htm", player), player, npc);
      return;
    }
    L2ItemInstance control = player.getInventory().getItemByObjectId(player.getPet().getControlItemObjId());
    control.setItemId(fwd ? RED_WS_ITEM : WIND_STRIDER_ITEM);
    control.updateDatabase(true, true);
    player.sendPacket(new ItemList(player, false));
    player.getPet().unSummon();
    show(Files.read("data/scripts/services/petevolve/end_msg_strider.htm", player), player, npc);
  }
View Full Code Here

    if(player.getInventory().getItemByItemId(fwd ? STAR_STRIDER_ITEM : RED_SS_ITEM) == null)
    {
      show(Files.read("data/scripts/services/petevolve/error_2.htm", player), player, npc);
      return;
    }
    L2ItemInstance control = player.getInventory().getItemByObjectId(player.getPet().getControlItemObjId());
    control.setItemId(fwd ? RED_SS_ITEM : STAR_STRIDER_ITEM);
    control.updateDatabase(true, true);
    player.sendPacket(new ItemList(player, false));
    player.getPet().unSummon();
    show(Files.read("data/scripts/services/petevolve/end_msg_strider.htm", player), player, npc);
  }
View Full Code Here

    if(player.getInventory().getItemByItemId(fwd ? TWILING_STRIDER_ITEM : RED_TW_ITEM) == null)
    {
      show(Files.read("data/scripts/services/petevolve/error_2.htm", player), player, npc);
      return;
    }
    L2ItemInstance control = player.getInventory().getItemByObjectId(player.getPet().getControlItemObjId());
    control.setItemId(fwd ? RED_TW_ITEM : TWILING_STRIDER_ITEM);
    control.updateDatabase(true, true);
    player.sendPacket(new ItemList(player, false));
    player.getPet().unSummon();
    show(Files.read("data/scripts/services/petevolve/end_msg_strider.htm", player), player, npc);
  }
View Full Code Here

    {
      player.sendMessage("Already max count.");
      return;
    }
    L2Item item = ItemTable.getInstance().getTemplate(Config.SERVICES_EXPAND_INVENTORY_ITEM);
    L2ItemInstance pay = player.getInventory().getItemByItemId(item.getItemId());
    if(pay != null && pay.getCount() >= Config.SERVICES_EXPAND_INVENTORY_PRICE)
    {
      player.getInventory().destroyItem(pay, Config.SERVICES_EXPAND_INVENTORY_PRICE, true);
      player.setExpandInventory(player.getExpandInventory() + 1);
      player.setVar("ExpandInventory", String.valueOf(player.getExpandInventory()));
      player.sendMessage("Inventory capacity is now " + player.getInventoryLimit());
View Full Code Here

  public void get(String[] param)
  {
    L2Player player = (L2Player) getSelf();
    int i = Integer.parseInt(param[0]);
    L2Item item = ItemTable.getInstance().getTemplate(Config.SERVICES_RATE_BONUS_ITEM[i]);
    L2ItemInstance pay = player.getInventory().getItemByItemId(item.getItemId());
    if(pay != null && pay.getCount() >= Config.SERVICES_RATE_BONUS_PRICE[i])
    {
      player.getInventory().destroyItem(pay, Config.SERVICES_RATE_BONUS_PRICE[i], true);
      Log.add(player.getName() + "|" + player.getObjectId() + "|rate bonus|" + Config.SERVICES_RATE_BONUS_VALUE[i] + "|" + Config.SERVICES_RATE_BONUS_DAYS[i] + "|", "services");
      try
      {
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.items.L2ItemInstance$LazyUpdateInDb

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.