Package l2p.gameserver.model.items

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


      {
        penaltyMonster();
      }
      else
      {
        L2ItemInstance item = ItemTable.getInstance().createItem(_fishID);
        fisher.getInventory().addItem(item);
        fisher.sendPacket(Msg.SUCCEEDED_IN_FISHING, new SystemMessage(SystemMessage.YOU_HAVE_OBTAINED_S1).addItemName(_fishID));
      }
    }
    fisher.endFishing(win);
View Full Code Here


  {
    for(L2TerritoryFlagInstance flag : _flags)
    {
      if(flag != null)
      {
        L2ItemInstance item = flag.getItem();
        if(item != null)
        {
          if(item.getOwnerId() > 0)
          {
            L2Player owner = L2ObjectsStorage.getPlayer(item.getOwnerId());
            if(owner != null)
            {
              item = owner.getInventory().dropItem(item, item.getCount(), true);
            }
          }
          item.deleteMe();
        }
        flag.deleteMe();
      }
    }
    _flags.clear();
View Full Code Here

        player.setAgathion(0);
      }
      // Обновляем скилл лист, после удаления скилов
      player.sendPacket(new SkillList(player));
      // Remove Hero weapons
      L2ItemInstance wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
      if(wpn != null && wpn.isHeroWeapon())
      {
        player.getInventory().unEquipItem(wpn);
        player.abortAttack(true, true);
        player.refreshExpertisePenalty();
      }
      // remove bsps/sps/ss automation
      ConcurrentSkipListSet<Integer> activeSoulShots = player.getAutoSoulShot();
      for(int itemId : activeSoulShots)
      {
        player.removeAutoSoulShot(itemId);
        player.sendPacket(new ExAutoSoulShot(itemId, false));
      }
      // Разряжаем заряженные соул и спирит шоты
      L2ItemInstance weapon = player.getActiveWeaponInstance();
      if(weapon != null)
      {
        weapon.setChargedSpiritshot(L2ItemInstance.CHARGED_NONE);
        weapon.setChargedSoulshot(L2ItemInstance.CHARGED_NONE);
      }
      player.setCurrentHpMp(player.getMaxHp(), player.getMaxMp());
      player.setCurrentCp(player.getMaxCp());
      player.broadcastUserInfo(true);
    }
View Full Code Here

  private void spawnFlags()
  {
    for(SiegeSpawn sp : FortressSiegeManager.getFlagsList(getSiegeUnit().getId()))
    {
      L2ItemInstance flag = ItemTable.getInstance().createItem(sp.getNpcId());
      flag.setCustomFlags(L2ItemInstance.FLAG_EQUIP_ON_PICKUP | L2ItemInstance.FLAG_NO_DESTROY | L2ItemInstance.FLAG_NO_TRADE | L2ItemInstance.FLAG_NO_UNEQUIP, false);
      flag.setXYZInvisible(sp.getLoc().correctGeoZ());
      flag.spawnMe();
      _flags.add(flag);
    }
  }
View Full Code Here

      activeChar.sendActionFailed();
      return;
    }
    PetInventory petInventory = pet.getInventory();
    PcInventory playerInventory = activeChar.getInventory();
    L2ItemInstance petItem = petInventory.getItemByObjectId(_objectId);
    if(petItem == null)
    {
      _log.warning(activeChar.getName() + " requested item obj_id: " + _objectId + " from pet, but its not there.");
      return;
    }
    if(petItem.isEquipped())
    {
      activeChar.sendActionFailed();
      return;
    }
    long finalLoad = petItem.getItem().getWeight() * _amount;
    if(!activeChar.getInventory().validateWeight(finalLoad))
    {
      sendPacket(Msg.YOU_HAVE_EXCEEDED_THE_WEIGHT_LIMIT);
      return;
    }
    L2ItemInstance item = petInventory.dropItem(_objectId, _amount, false);
    item.setCustomFlags(item.getCustomFlags() & ~L2ItemInstance.FLAG_PET_EQUIPPED, true);
    playerInventory.addItem(item);
    pet.sendItemList();
    pet.broadcastPetInfo();
    Log.LogItem(activeChar, activeChar.getPet(), Log.GetItemFromPet, petItem);
  }
View Full Code Here

  private void tradeItems(L2Player player, L2Player reciever)
  {
    ConcurrentLinkedQueue<TradeItem> exchangeList = getExchangeList(player);
    Inventory playersInv = player.getInventory();
    Inventory recieverInv = reciever.getInventory();
    L2ItemInstance recieverItem, TransferItem;
    for(TradeItem temp : exchangeList)
    {
      if(temp.getObjectId() == 0)
      {
        _log.warning("Warning: null object id item, player " + player);
View Full Code Here

      _spawnTimer = null;
    }
    if(getParty() != null)
    {
      L2Player player = getParty().getPartyLeader();
      L2ItemInstance bloodOfferings = player.getInventory().getItemByItemId(SevenSignsFestival.FESTIVAL_BLOOD_OFFERING);
      // Check if the player collected any blood offerings during the festival.
      if(bloodOfferings != null)
      {
        long offeringCount = bloodOfferings.getCount();
        long offeringScore = offeringCount * SevenSignsFestival.FESTIVAL_OFFERING_VALUE;
        boolean isHighestScore = SevenSignsFestival.getInstance().setFinalScore(getParty(), _cabal, _levelRange, offeringScore);
        player.getInventory().destroyItem(bloodOfferings, offeringCount, true);
        // Send message that the contribution score has increased.
        player.sendPacket(new SystemMessage(SystemMessage.YOUR_CONTRIBUTION_SCORE_IS_INCREASED_BY_S1).addNumber(offeringScore));
View Full Code Here

    if(activeChar == null)
    {
      return;
    }
    PcInventory inventory = activeChar.getInventory();
    L2ItemInstance itemToEnchant = inventory.getItemByObjectId(_itemId);
    L2ItemInstance catalyst = inventory.getItemByObjectId(_catalystId);
    if(checkCatalyst(itemToEnchant, catalyst))
    {
      activeChar.sendPacket(new ExPutEnchantSupportItemResult(1));
    }
    else
View Full Code Here

    if (!activeChar.isInRangeSq(_loc, 22500) || Math.abs(_loc.z - activeChar.getZ()) > 50)
    {
      activeChar.sendPacket(Msg.THAT_IS_TOO_FAR_FROM_YOU_TO_DISCARD);
      return;
    }
    L2ItemInstance oldItem = activeChar.getInventory().getItemByObjectId(_objectId);
    if (oldItem == null)
    {
      activeChar.sendActionFailed();
      return;
    }
    if (!oldItem.canBeDropped(activeChar, false))
    {
      activeChar.sendPacket(Msg.THAT_ITEM_CANNOT_BE_DISCARDED);
      return;
    }
    long oldCount = oldItem.getCount();
    if (oldCount < _count)
    {
      activeChar.sendActionFailed();
      return;
    }
    L2ItemInstance dropedItem = activeChar.getInventory().dropItem(_objectId, _count, false);
    if (dropedItem == null)
    {
      activeChar.sendActionFailed();
      return;
    }
    dropedItem.dropToTheGround(activeChar, _loc);
    Log.LogItem(activeChar, Log.Drop, dropedItem);
    activeChar.updateStats();
  }
View Full Code Here

      return;
    }
    // Другие условия?
    // activeChar.sendPacket(Msg.YOU_CANNOT_CONTROL_BECAUSE_YOU_DO_NOT_MEET_THE_REQUIREMENTS);
    // разоружаем
    L2ItemInstance weapon = activeChar.getActiveWeaponInstance();
    L2ItemInstance weapon2 = activeChar.getSecondaryWeaponInstance();
    if(weapon != null)
    {
      activeChar.getInventory().unEquipItemInBodySlotAndNotify(weapon.getBodyPart(), weapon);
    }
    if(weapon2 != null)
    {
      activeChar.getInventory().unEquipItemInBodySlotAndNotify(weapon2.getBodyPart(), weapon2);
    }
    // Берем в руки штурвал
    airship.setDriver(activeChar);
    activeChar.broadcastUserInfo(true);
  }
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.