Package l2p.gameserver.model.items

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


    }
    for(L2Player player : getPlayers())
    {
      try
      {
        L2ItemInstance item = player.getInventory().addItem(Config.ALT_OLY_BATTLE_REWARD_ITEM, _game.getType().getReward());
        player.sendPacket(SystemMessage.obtainItems(item.getItemId(), _game.getType().getReward(), 0));
      }
      catch(Exception e)
      {
        e.printStackTrace();
      }
View Full Code Here


      }
    }
    if(newweapon != 0)
    {
      L2ItemInstance[] olditem = st.getPlayer().getInventory().getAllItemsById(st.getInt("oldweapon"));
      L2ItemInstance itemtotake = null;
      for(L2ItemInstance i : olditem)
      {
        if(!i.isAugmented() && i.getEnchantLevel() == 0)
        {
          itemtotake = i;
View Full Code Here

  @Override
  public void onBypassFeedback(L2Player player, String command)
  {
    if(command.startsWith("open_gate"))
    {
      L2ItemInstance hallsKey = player.getInventory().getItemByItemId(HALLS_KEY);
      if(hallsKey == null)
      {
        showHtmlFile(player, "Gatekeeper-no.htm");
      }
      else if(FourSepulchersManager.isAttackTime())
      {
        switch(getNpcId())
        {
          case 31929:
          case 31934:
          case 31939:
          case 31944:
            FourSepulchersSpawn.spawnShadow(getNpcId());
        }
        // Moved here from switch-default
        openNextDoor(getNpcId());
        if(player.getParty() != null)
        {
          for(L2Player mem : player.getParty().getPartyMembers())
          {
            hallsKey = mem.getInventory().getItemByItemId(HALLS_KEY);
            if(hallsKey != null)
            {
              Functions.removeItem(mem, HALLS_KEY, hallsKey.getCount());
            }
          }
        }
        else
        {
          Functions.removeItem(player, HALLS_KEY, hallsKey.getCount());
        }
      }
    }
    else
    {
View Full Code Here

      {
        count++;
        temp = L2ObjectsStorage.getAllByNpcId(rset.getInt("owner_id"), false);
        try
        {
          L2ItemInstance item = L2ItemInstance.restoreFromDb(rset.getInt("object_id"), true);
          if(temp.size() > 0)
          {
            L2MonsterInstance monster = (L2MonsterInstance) temp.toArray()[Rnd.get(temp.size())];
            monster.giveItem(item, false);
          }
View Full Code Here

    if(st.nextToken().equals("change_class"))
    {
      short val = Short.parseShort(st.nextToken());
      long price = Long.parseLong(st.nextToken());
      L2Item item = ItemTable.getInstance().getTemplate(Config.CLASS_MASTERS_PRICE_ITEM);
      L2ItemInstance pay = player.getInventory().getItemByItemId(item.getItemId());
      if(pay != null && pay.getCount() >= price)
      {
        player.getInventory().destroyItem(pay, price, true);
        changeClass(player, val);
      }
      else if(Config.CLASS_MASTERS_PRICE_ITEM == 57)
View Full Code Here

      pet.setName(_name);
      pet.broadcastPetInfo();
      if(pet.isPet())
      {
        L2PetInstance _pet = (L2PetInstance) pet;
        L2ItemInstance controlItem = _pet.getControlItem();
        if(controlItem != null)
        {
          controlItem.setCustomType2(1);
          controlItem.setPriceToSell(0); // Костыль, иначе CustomType2 = 1 не пишется в базу
          controlItem.updateDatabase();
          _pet.updateControlItem();
        }
      }
    }
  }
View Full Code Here

        {
          showHtmlFile(player, "data/html/rift/NotInWaitingRoom.htm", npc);
          return;
        }
      }
      L2ItemInstance i;
      for(L2Player p : player.getParty().getPartyMembers())
      {
        i = p.getInventory().getItemByItemId(DIMENSIONAL_FRAGMENT_ITEM_ID);
        if(i == null || i.getCount() < getNeededItems(type))
        {
          showHtmlFile(player, "data/html/rift/NoFragments.htm", npc);
          return;
        }
      }
View Full Code Here

  @Override
  protected void runImpl()
  {
    L2Player activeChar = getClient().getActiveChar();
    L2ItemInstance targetItem = activeChar.getInventory().getItemByObjectId(_targetItemObjId);
    // cannot remove augmentation from a not augmented item
    if(targetItem == null || !targetItem.isAugmented())
    {
      activeChar.sendPacket(new ExVariationCancelResult(0), Msg.AUGMENTATION_REMOVAL_CAN_ONLY_BE_DONE_ON_AN_AUGMENTED_ITEM);
      return;
    }
    // get the price
    int price = getRemovalPrice(targetItem.getItem());
    if(price < 0)
    {
      activeChar.sendPacket(new ExVariationCancelResult(0));
    }
    // try to reduce the players adena
    if(activeChar.getAdena() < price)
    {
      activeChar.sendPacket(new ExVariationCancelResult(0), Msg.YOU_DO_NOT_HAVE_ENOUGH_ADENA);
      return;
    }
    activeChar.reduceAdena(price, true);
    // cancel boni
    targetItem.getAugmentation().removeBoni(activeChar);
    // remove the augmentation
    targetItem.removeAugmentation();
    // send inventory update
    InventoryUpdate iu = new InventoryUpdate();
    iu.addModifiedItem(targetItem);
    // send system message
    SystemMessage sm = new SystemMessage(SystemMessage.AUGMENTATION_HAS_BEEN_SUCCESSFULLY_REMOVED_FROM_YOUR_S1);
    sm.addItemName(targetItem.getItemId());
    activeChar.sendPacket(new ExVariationCancelResult(1), iu, sm);
    activeChar.broadcastUserInfo(true);
  }
View Full Code Here

  {
    super.onStart();
    L2Player player = _effected.getPlayer();
    if(player != null)
    {
      L2ItemInstance weapon = player.getActiveWeaponInstance();
      if(weapon != null)
      {
        player.getInventory().unEquipItemInBodySlotAndNotify(weapon.getBodyPart(), weapon);
      }
    }
  }
View Full Code Here

    L2Player p = (L2Player) activeChar;
    if(p.getPrivateStoreType() != L2Player.STORE_PRIVATE_NONE || p.isInTransaction())
    {
      return false;
    }
    L2ItemInstance item = activeChar.getActiveWeaponInstance();
    if(item != null && convertWeaponId(item.getItemId()) == 0)
    {
      activeChar.sendPacket(Msg.YOU_CANNOT_CONVERT_THIS_ITEM);
      return false;
    }
    return super.checkCondition(activeChar, target, forceUse, dontMove, first);
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.