Package com.l2jfrozen.gameserver.model.actor.instance

Examples of com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance$ScheduleConsumeManaTask


      int rewradItemCount = 1; //L2Manor.getInstance().getRewardAmount(itemId, manor.getCastle().getCropReward(itemId));

      rewradItemCount = count / rewradItemCount;

      // Add item to Inventory and adjust update packet
      L2ItemInstance item = player.getInventory().addItem("Manor", rewradItemId, rewradItemCount, player, manor);
      L2ItemInstance iteme = player.getInventory().destroyItemByItemId("Manor", itemId, count, player, manor);

      if(item == null || iteme == null)
      {
        continue;
      }
View Full Code Here


    target = null;

    // now we need to find the equipped weapon of the targeted character...
    int curEnchant = 0; // display purposes only

    L2ItemInstance itemInstance = null;

    // only attempt to enchant if there is a weapon equipped
    L2ItemInstance parmorInstance = player.getInventory().getPaperdollItem(armorType);

    if(parmorInstance != null && parmorInstance.getEquipSlot() == armorType)
    {
      itemInstance = parmorInstance;
    }
    else
    {
      // for bows and double handed weapons
      parmorInstance = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LRHAND);

      if(parmorInstance != null && parmorInstance.getEquipSlot() == Inventory.PAPERDOLL_LRHAND)
      {
        itemInstance = parmorInstance;
      }
    }
View Full Code Here

            if(castle != null && !castle.getSiege().getIsInProgress())
            {
              itemId = ITEM_IDS[i];
              // create the ticket in the gameworld
              L2ItemInstance dropticket = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId);
              dropticket.setLocation(L2ItemInstance.ItemLocation.VOID);
              dropticket.dropMe(null, x, y, z);
              dropticket.setDropTime(0); //avoids it from beeing removed by the auto item destroyer
              L2World.getInstance().storeObject(dropticket);
              getDroppedTickets().add(dropticket);
              dropticket = null;
            }
            break;
View Full Code Here

    if(limit <= 0)
      return true;

    int count = 0;
    L2ItemInstance ticket;
    for(int i = 0; i < getDroppedTickets().size(); i++)
    {
      ticket = getDroppedTickets().get(i);
      if(ticket != null && ticket.getItemId() == itemId)
      {
        count++;
      }
    }
    ticket = null;
View Full Code Here

    int limit = MERCS_MAX_PER_CASTLE[castleId - 1];
    if(limit <= 0)
      return true;

    int count = 0;
    L2ItemInstance ticket;
    for(int i = 0; i < getDroppedTickets().size(); i++)
    {
      ticket = getDroppedTickets().get(i);
      if(ticket != null && getTicketCastleId(ticket.getItemId()) == castleId)
      {
        count++;
      }
    }
    ticket = null;
View Full Code Here

        // Hire merc for this caslte.  NpcId is at the same index as the item used.
        castle.getSiege().getSiegeGuardManager().hireMerc(x, y, z, heading, NPC_IDS[i]);

        // create the ticket in the gameworld
        L2ItemInstance dropticket = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId);
        dropticket.setLocation(L2ItemInstance.ItemLocation.INVENTORY);
        dropticket.dropMe(null, x, y, z);
        dropticket.setDropTime(0); //avoids it from beeing removed by the auto item destroyer
        L2World.getInstance().storeObject(dropticket); //add to the world
        // and keep track of this ticket in the list
        _droppedTickets.add(dropticket);

        dropticket = null;
View Full Code Here

  public void deleteTickets(int castleId)
  {
    int i = 0;
    while(i < getDroppedTickets().size())
    {
      L2ItemInstance item = getDroppedTickets().get(i);
      if(item != null && getTicketCastleId(item.getItemId()) == castleId)
      {
        item.decayMe();
        L2World.getInstance().removeObject(item);

        // remove from the list
        getDroppedTickets().remove(i);
      }
View Full Code Here

   */
  public L2ItemInstance DropItem(L2PcInstance mainDamageDealer, RewardItem item)
  {
    int randDropLim = 70;

    L2ItemInstance ditem = null;

    for(int i = 0; i < item.getCount(); i++)
    {
      // Randomize drop position
      int newX = getX() + Rnd.get(randDropLim * 2 + 1) - randDropLim;
      int newY = getY() + Rnd.get(randDropLim * 2 + 1) - randDropLim;
      int newZ = Math.max(getZ(), mainDamageDealer.getZ()) + 20; // TODO: temp hack, do somethign nicer when we have geodatas

      // Init the dropped L2ItemInstance and add it in the world as a visible object at the position where mob was last
      ditem = ItemTable.getInstance().createItem("Loot", item.getItemId(), item.getCount(), mainDamageDealer, this);
      ditem.getDropProtection().protect(mainDamageDealer);
      ditem.dropMe(this, newX, newY, newZ);

      // Add drop to auto destroy item task
      if(!Config.LIST_PROTECTED_ITEMS.contains(item.getItemId()))
      {
        if(Config.AUTODESTROY_ITEM_AFTER > 0 && ditem.getItemType() != L2EtcItemType.HERB || Config.HERB_AUTO_DESTROY_TIME > 0 && ditem.getItemType() == L2EtcItemType.HERB)
        {
          ItemsAutoDestroy.getInstance().addItem(ditem);
        }
      }

      ditem.setProtected(false);

      // If stackable, end loop as entire count is included in 1 instance of item
      if(ditem.isStackable() || !Config.MULTIPLE_ITEM_DROP)
      {
        break;
      }
    }
    return ditem;
View Full Code Here

    crystalNME = null;
  }

  private void exchangeCrystal(L2PcInstance player, int takeid, int giveid, boolean broke)
  {
    L2ItemInstance Item = player.getInventory().destroyItemByItemId("SoulCrystal", takeid, 1, player, this);

    if(Item != null)
    {
      // Prepare inventory update packet
      InventoryUpdate playerIU = new InventoryUpdate();
View Full Code Here

      try
      {
        result = " (" + playerOneHp + "hp vs " + playerTwoHp + "hp - "
                + _damageP1 + "dmg vs " + _damageP2 + "dmg) "
                + _playerOneName + " win " + pointDiff + " points";
        L2ItemInstance item = _playerOne.getInventory().addItem("Olympiad", Config.ALT_OLY_BATTLE_REWARD_ITEM, _gpreward, _playerOne, null);
        InventoryUpdate iu = new InventoryUpdate();
        iu.addModifiedItem(item);
        _playerOne.sendPacket(iu);
       
        SystemMessage sm = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
        sm.addItemName(item.getItemId());
        sm.addNumber(_gpreward);
        _playerOne.sendPacket(sm);
      }
      catch (Exception e)
      {
      }
    }
    else if (_playerOne == null
            || _playerOne.isOnline() == 0
            || (playerOneHp == 0 && playerTwoHp != 0)
            || (_damageP2 > _damageP1 && playerOneHp != 0 && playerTwoHp != 0))
    {
      playerTwoStat.set(POINTS, playerTwoPoints + pointDiff);
      playerOneStat.set(POINTS, playerOnePoints - pointDiff);
      playerTwoStat.set(COMP_WON, playerTwoWon + 1);
      playerOneStat.set(COMP_LOST, playerOneLost + 1);
     
      _sm.addString(_playerTwoName);
      broadcastMessage(_sm, true);
      _sm2.addString(_playerTwoName);
      _sm2.addNumber(pointDiff);
      broadcastMessage(_sm2, false);
      _sm3.addString(_playerOneName);
      _sm3.addNumber(pointDiff);
      broadcastMessage(_sm3, false);
      winner = _playerTwoName + " won";
     
      try
      {
        result = " (" + playerOneHp + "hp vs " + playerTwoHp + "hp - "
                + _damageP1 + "dmg vs " + _damageP2 + "dmg) "
                + _playerTwoName + " win " + pointDiff + " points";
        L2ItemInstance item = _playerTwo.getInventory().addItem("Olympiad", Config.ALT_OLY_BATTLE_REWARD_ITEM, _gpreward, _playerTwo, null);
        InventoryUpdate iu = new InventoryUpdate();
        iu.addModifiedItem(item);
        _playerTwo.sendPacket(iu);
       
        SystemMessage sm = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
        sm.addItemName(item.getItemId());
        sm.addNumber(_gpreward);
        _playerTwo.sendPacket(sm);
      }
      catch (Exception e)
      {
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance$ScheduleConsumeManaTask

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.