Examples of PcInventory


Examples of l2p.gameserver.model.items.PcInventory

    if(activeChar.isOutOfControl() || activeChar.isActionsDisabled())
    {
      activeChar.sendPacket(new ExPutEnchantTargetItemResult(0, 0, 0));
      return;
    }
    PcInventory inventory = activeChar.getInventory();
    L2ItemInstance itemToEnchant = inventory.getItemByObjectId(_objectId);
    L2ItemInstance scroll = activeChar.getEnchantScroll();
    if(itemToEnchant == null || scroll == null)
    {
      activeChar.sendPacket(new ExPutEnchantTargetItemResult(0, 0, 0));
      return;
    }
    // С помощью Master Yogi's Scroll: Enchant Weapon можно точить только Staff of Master Yogi
    if(scroll.getItemId() == 13540 && itemToEnchant.getItemId() != 13539 || itemToEnchant.getItemId() == 13539 && scroll.getItemId() != 13540)
    {
      activeChar.sendActionFailed();
      activeChar.sendPacket(Msg.INAPPROPRIATE_ENCHANT_CONDITIONS);
      return;
    }
    Log.add(activeChar.getName() + "|Trying to put enchant|" + itemToEnchant.getItemId() + "|+" + itemToEnchant.getEnchantLevel() + "|" + itemToEnchant.getObjectId(), "enchants");
    // Затычка, разрешающая точить Staff of Master Yogi
    if(!itemToEnchant.canBeEnchanted() && itemToEnchant.getItemId() != 13539 && !(itemToEnchant.getItem().isCloak() && Config.ALLOW_ENCHANT_CLOAKS) || itemToEnchant.isStackable())
    {
      activeChar.sendActionFailed();
      activeChar.sendPacket(Msg.DOES_NOT_FIT_STRENGTHENING_CONDITIONS_OF_THE_SCROLL);
      return;
    }
    if(itemToEnchant.getLocation() != L2ItemInstance.ItemLocation.INVENTORY && itemToEnchant.getLocation() != L2ItemInstance.ItemLocation.PAPERDOLL)
    {
      activeChar.sendActionFailed();
      activeChar.sendPacket(Msg.INAPPROPRIATE_ENCHANT_CONDITIONS);
      return;
    }
    if(activeChar.getPrivateStoreType() != L2Player.STORE_PRIVATE_NONE)
    {
      activeChar.sendPacket(new ExPutEnchantTargetItemResult(0, 0, 0));
      activeChar.sendPacket(Msg.YOU_CANNOT_PRACTICE_ENCHANTING_WHILE_OPERATING_A_PRIVATE_STORE_OR_PRIVATE_MANUFACTURING_WORKSHOP);
      return;
    }
    if((scroll = inventory.getItemByObjectId(scroll.getObjectId())) == null)
    {
      activeChar.setEnchantScroll(null);
      activeChar.sendPacket(new ExPutEnchantTargetItemResult(0, 0, 0));
      return;
    }
View Full Code Here

Examples of l2p.gameserver.model.items.PcInventory

    }
    if(!FloodProtector.tryPerformAction(activeChar, Action.ENCHANT_ITEM))
    {
      return;
    }
    PcInventory inventory = activeChar.getInventory();
    L2ItemInstance itemToEnchant = inventory.getItemByObjectId(_objectId);
    L2ItemInstance catalyst = _catalystObjId > 0 ? inventory.getItemByObjectId(_catalystObjId) : null;
    L2ItemInstance scroll = activeChar.getEnchantScroll();
    activeChar.setEnchantScroll(null);
    if(itemToEnchant == null || scroll == null)
    {
      activeChar.sendActionFailed();
      return;
    }
    // Затычка, ибо клиент криво обрабатывает RequestExTryToPutEnchantSupportItem
    if(!RequestExTryToPutEnchantSupportItem.checkCatalyst(itemToEnchant, catalyst))
    {
      catalyst = null;
    }
    // С помощью Master Yogi's Scroll: Enchant Weapon можно точить только Staff of Master Yogi
    if(scroll.getItemId() == 13540 && itemToEnchant.getItemId() != 13539 || itemToEnchant.getItemId() == 13539 && scroll.getItemId() != 13540)
    {
      activeChar.sendPacket(EnchantResult.CANCEL);
      activeChar.sendPacket(Msg.INAPPROPRIATE_ENCHANT_CONDITIONS);
      activeChar.sendActionFailed();
      return;
    }
    Log.add(activeChar.getName() + "|Trying to enchant|" + itemToEnchant.getItemId() + "|+" + itemToEnchant.getEnchantLevel() + "|" + itemToEnchant.getObjectId(), "enchants");
    // Затычка, разрешающая точить Staff of Master Yogi
    if(!itemToEnchant.canBeEnchanted() && !isYogiStaffEnchanting(scroll, itemToEnchant) && !(itemToEnchant.getItem().isCloak() && Config.ALLOW_ENCHANT_CLOAKS))
    {
      activeChar.sendPacket(EnchantResult.CANCEL);
      activeChar.sendPacket(Msg.INAPPROPRIATE_ENCHANT_CONDITIONS);
      activeChar.sendActionFailed();
      return;
    }
    if(itemToEnchant.getLocation() != L2ItemInstance.ItemLocation.INVENTORY && itemToEnchant.getLocation() != L2ItemInstance.ItemLocation.PAPERDOLL)
    {
      activeChar.sendPacket(EnchantResult.CANCEL);
      activeChar.sendPacket(Msg.INAPPROPRIATE_ENCHANT_CONDITIONS);
      activeChar.sendActionFailed();
      return;
    }
    if(activeChar.getPrivateStoreType() != L2Player.STORE_PRIVATE_NONE)
    {
      activeChar.sendPacket(EnchantResult.CANCEL);
      activeChar.sendPacket(Msg.YOU_CANNOT_PRACTICE_ENCHANTING_WHILE_OPERATING_A_PRIVATE_STORE_OR_PRIVATE_MANUFACTURING_WORKSHOP);
      activeChar.sendActionFailed();
      return;
    }
    if(itemToEnchant.isStackable() || (scroll = inventory.getItemByObjectId(scroll.getObjectId())) == null)
    {
      activeChar.sendPacket(EnchantResult.CANCEL);
      activeChar.sendActionFailed();
      return;
    }
    int crystalId = itemToEnchant.getEnchantCrystalId(scroll, catalyst);
    // Затычка, разрешающая точить Staff of Master Yogi
    if(crystalId == 0 && !isYogiStaffEnchanting(scroll, itemToEnchant))
    {
      activeChar.sendPacket(EnchantResult.CANCEL);
      activeChar.sendPacket(Msg.INAPPROPRIATE_ENCHANT_CONDITIONS);
      activeChar.sendActionFailed();
      return;
    }
    // Staff of Master Yogi можно точить до 23
    if(!isYogiStaffEnchanting(scroll, itemToEnchant) && itemToEnchant.getEnchantLevel() >= getMaxEnchant(itemToEnchant) || isYogiStaffEnchanting(scroll, itemToEnchant) && itemToEnchant.getEnchantLevel() >= 23)
    {
      activeChar.sendPacket(EnchantResult.CANCEL);
      activeChar.sendMessage(new CustomMessage("l2p.gameserver.clientpackets.RequestEnchantItem.MaxLevel", activeChar));
      activeChar.sendActionFailed();
      return;
    }
    // Запрет на заточку чужих вещей, баг может вылезти на серверных лагах
    if(itemToEnchant.getOwnerId() != activeChar.getObjectId())
    {
      activeChar.sendPacket(EnchantResult.CANCEL);
      activeChar.sendPacket(Msg.INAPPROPRIATE_ENCHANT_CONDITIONS);
      activeChar.sendActionFailed();
      return;
    }
    L2ItemInstance removedScroll, removedCatalyst = null;
    synchronized(inventory)
    {
      removedScroll = inventory.destroyItem(scroll.getObjectId(), 1, true);
      if(catalyst != null)
      {
        removedCatalyst = inventory.destroyItem(catalyst.getObjectId(), 1, true);
      }
    }
    //tries enchant without scrolls
    if(removedScroll == null || catalyst != null && removedCatalyst == null)
    {
      activeChar.sendPacket(EnchantResult.CANCEL);
      activeChar.sendActionFailed();
      return;
    }
    int itemType = itemToEnchant.getItem().getType2();
    int safeEnchantLevel = itemToEnchant.getItem().getBodyPart() == L2Item.SLOT_FULL_ARMOR ? Config.SAFE_ENCHANT_FULL_BODY : Config.SAFE_ENCHANT_COMMON;
    int enchantlevel = itemToEnchant.getEnchantLevel();
    double chance;
    if(itemToEnchant.getEnchantLevel() < safeEnchantLevel)
    {
      chance = 100;
    }
    else if(itemType == L2Item.TYPE2_WEAPON)
    {
    if (Config.USE_ALT_ENCHANT)
      {
      if (removedScroll.isCrystallEnchantScroll())
        chance = enchantlevel > Config.ENCHANT_WEAPON_FIGHT_CRYSTAL.size() ? Config.ENCHANT_WEAPON_FIGHT_CRYSTAL.get(Config.ENCHANT_WEAPON_FIGHT_CRYSTAL.size()-1) : Config.ENCHANT_WEAPON_FIGHT_CRYSTAL.get(enchantlevel);
      else if (removedScroll.isBlessedEnchantScroll())
        chance = enchantlevel > Config.ENCHANT_WEAPON_FIGHT_BLESSED.size() ? Config.ENCHANT_WEAPON_FIGHT_BLESSED.get(Config.ENCHANT_WEAPON_FIGHT_BLESSED.size()-1) : Config.ENCHANT_WEAPON_FIGHT_BLESSED.get(enchantlevel);
      else
        chance = enchantlevel > Config.ENCHANT_WEAPON_FIGHT.size() ? Config.ENCHANT_WEAPON_FIGHT.get(Config.ENCHANT_WEAPON_FIGHT.size()-1) : Config.ENCHANT_WEAPON_FIGHT.get(enchantlevel);
      }
      else
      chance = removedScroll.isCrystallEnchantScroll() ? Config.ENCHANT_CHANCE_CRYSTAL_WEAPON :removedScroll.isBlessedEnchantScroll() ? Config.ENCHANT_CHANCE_BLESSED_WEAPON : Config.ENCHANT_CHANCE_WEAPON;
    }
    else if(itemType == L2Item.TYPE2_SHIELD_ARMOR)
    {
      if (Config.USE_ALT_ENCHANT)
      {
      if (removedScroll.isCrystallEnchantScroll())
        chance = enchantlevel > Config.ENCHANT_ARMOR_CRYSTAL.size() ? Config.ENCHANT_ARMOR_CRYSTAL.get(Config.ENCHANT_ARMOR_CRYSTAL.size()-1) : Config.ENCHANT_ARMOR_CRYSTAL.get(enchantlevel);
      else if (removedScroll.isBlessedEnchantScroll())
        chance = enchantlevel > Config.ENCHANT_ARMOR_BLESSED.size() ? Config.ENCHANT_ARMOR_BLESSED.get(Config.ENCHANT_ARMOR_BLESSED.size()-1) : Config.ENCHANT_ARMOR_BLESSED.get(enchantlevel);
      else
        chance = enchantlevel > Config.ENCHANT_ARMOR.size() ? Config.ENCHANT_ARMOR.get(Config.ENCHANT_ARMOR.size()-1) : Config.ENCHANT_ARMOR.get(enchantlevel);
      }
      else
      chance = removedScroll.isCrystallEnchantScroll() ? Config.ENCHANT_CHANCE_CRYSTAL_ARMOR : removedScroll.isBlessedEnchantScroll() ? Config.ENCHANT_CHANCE_BLESSED_ARMOR : Config.ENCHANT_CHANCE_ARMOR;
    }
    else if(itemType == L2Item.TYPE2_ACCESSORY)
    {
      if (Config.USE_ALT_ENCHANT)
      {
      if (removedScroll.isCrystallEnchantScroll())
        chance = enchantlevel > Config.ENCHANT_ARMOR_JEWELRY_CRYSTAL.size() ? Config.ENCHANT_ARMOR_JEWELRY_CRYSTAL.get(Config.ENCHANT_ARMOR_JEWELRY_CRYSTAL.size()-1) : Config.ENCHANT_ARMOR_JEWELRY_CRYSTAL.get(enchantlevel);
      else if (removedScroll.isBlessedEnchantScroll())
        chance = enchantlevel > Config.ENCHANT_ARMOR_JEWELRY_BLESSED.size() ? Config.ENCHANT_ARMOR_JEWELRY_BLESSED.get(Config.ENCHANT_ARMOR_JEWELRY_BLESSED.size()-1) : Config.ENCHANT_ARMOR_JEWELRY_BLESSED.get(enchantlevel);
      else
        chance = enchantlevel > Config.ENCHANT_ARMOR_JEWELRY.size() ? Config.ENCHANT_ARMOR_JEWELRY.get(Config.ENCHANT_ARMOR_JEWELRY.size()-1) : Config.ENCHANT_ARMOR_JEWELRY.get(enchantlevel);
      }
      else
      chance = removedScroll.isCrystallEnchantScroll() ? Config.ENCHANT_CHANCE_CRYSTAL_ACCESSORY : removedScroll.isBlessedEnchantScroll() ? Config.ENCHANT_CHANCE_BLESSED_ACCESSORY : Config.ENCHANT_CHANCE_ACCESSORY;
    }
    else
    {
      System.out.println("WTF? Request to enchant " + itemToEnchant.getItemId());
      activeChar.sendPacket(EnchantResult.CANCEL);
      activeChar.sendActionFailed();
      activeChar.sendPacket(Msg.SYSTEM_ERROR);
      inventory.addItem(removedScroll);
      return;
    }
    if(scroll.isDivineEnchantScroll()) // Item Mall divine
    {
      chance = 100;
    }
    else if(scroll.isItemMallEnchantScroll()) // Item Mall normal/ancient
    {
      chance += 10;
    }
    if(removedCatalyst != null)
    {
      chance += removedCatalyst.getCatalystPower();
    }
    if (Config.ALT_ENCHANT_FOR_PVP)
    {
            int enchlvl = itemToEnchant.getEnchantLevel();
            L2Item.Grade crystaltype = itemToEnchant.getItem().getCrystalType();

            //для уровнения шансов дуальщиков и остальных на победу в PvP вставка SA в дули халявная
            if (itemType == L2Item.TYPE2_WEAPON && itemToEnchant.getItemType() == L2Weapon.WeaponType.DUAL)
                safeEnchantLevel += 1;

            if (enchlvl < safeEnchantLevel)
                chance = 100;
            else if (enchlvl > 11)
                chance = 1;
            else {
                // Выборка базового шанса
                if (itemType == L2Item.TYPE2_WEAPON) {
                    L2Weapon wepToEnchant = (L2Weapon) itemToEnchant.getItem();
                    boolean magewep = itemType == L2Item.TYPE2_WEAPON && crystaltype.cry >= L2Item.CRYSTAL_C && wepToEnchant.getPDamage() - wepToEnchant.getMDamage() <= wepToEnchant.getPDamage() * 0.4;
                    chance = !magewep ? Config.ENCHANT_CHANCE_WEAPON_PVP : Config.ENCHANT_CHANCE_MAGE_WEAPON_PVP;

                    // Штраф на двуручное оружие(немагическое)
                    if (itemToEnchant.getItem().getBodyPart() == L2Item.SLOT_LR_HAND && itemToEnchant.getItem().getItemType() == L2Weapon.WeaponType.BLUNT && !magewep)
                        chance -= Config.ENCHANT_PENALTY_FOR_BLUNT;
                } else
                    chance = Config.ENCHANT_CHANCE_ARMOR_PVP;

                int DeltaChance = 15;

                // Основная прогрессия
                for (int i = safeEnchantLevel; i < enchlvl; i++) {
                    if (i == safeEnchantLevel + 2)
                        DeltaChance -= 5;
                    if (i == safeEnchantLevel + 6)
                        DeltaChance -= 5;
                    chance -= DeltaChance;
                }

                // Учёт грейда
                int Delta2 = 5;
                for (int in = 0x00; in < crystaltype.ordinal(); in++) {
                    if (in == L2Item.CRYSTAL_C)
                        Delta2 -= 5;
                    if (in == L2Item.CRYSTAL_B)
                        Delta2 -= 5;
                    if (in == L2Item.CRYSTAL_A)
                        Delta2 -= 2;
                    if (in == L2Item.CRYSTAL_S)
                        Delta2 -= 1;
                }
                chance += Delta2;

                if (scroll.isBlessedEnchantScroll())
                    chance += 2;
                if (chance < 1)
                    chance = 1;
            }
        }
    if(Rnd.chance(chance))
    {
      itemToEnchant.setEnchantLevel(itemToEnchant.getEnchantLevel() + 1);
      itemToEnchant.updateDatabase();
      activeChar.sendPacket(new InventoryUpdate().addModifiedItem(itemToEnchant));
      Log.add(activeChar.getName() + "|Successfully enchanted|" + itemToEnchant.getItemId() + "|to+" + itemToEnchant.getEnchantLevel() + "|" + chance, "enchants");
      Log.LogItem(activeChar, Log.EnchantItem, itemToEnchant);
      activeChar.sendPacket(EnchantResult.SUCESS);
      if(Config.EnableFireworksEnhant && itemToEnchant.getEnchantLevel() >= (itemType == L2Item.TYPE2_WEAPON ? Config.FireworksEnhantWeapon : Config.FireworksEnhantArmor))
      {
        activeChar.altUseSkill(SkillTable.getInstance().getInfo(21006, 1), activeChar);
        activeChar.broadcastPacket(new SystemMessage(SystemMessage.C1_HAS_SUCCESSFULY_ENCHANTED_A__S2_S3).addName(activeChar).addNumber(itemToEnchant.getEnchantLevel()).addItemName(itemToEnchant.getItemId()));
      }
    }
    else
    {
      Log.add(activeChar.getName() + "|Failed to enchant|" + itemToEnchant.getItemId() + "|+" + itemToEnchant.getEnchantLevel() + "|" + chance, "enchants");
      if(scroll.isBlessedEnchantScroll()) // фейл, но заточка блесед
      {
        itemToEnchant.setEnchantLevel(Config.EnchantFail);
        activeChar.sendPacket(new InventoryUpdate().addModifiedItem(itemToEnchant));
        activeChar.sendPacket(Msg.FAILED_IN_BLESSED_ENCHANT_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0);
        activeChar.sendPacket(EnchantResult.BLESSED_FAILED);
      }
      else if(scroll.isAncientEnchantScroll()) // фейл, но заточка ancient
      {
        activeChar.sendPacket(EnchantResult.ANCIENT_FAILED);
      }
      else
      // фейл, разбиваем вещь
      {
        if(itemToEnchant.isEquipped())
        {
          inventory.unEquipItemInSlot(itemToEnchant.getEquipSlot());
        }
        L2ItemInstance destroyedItem = inventory.destroyItem(itemToEnchant.getObjectId(), 1, true);
        if(destroyedItem == null)
        {
          _log.warning("failed to destroy " + itemToEnchant.getObjectId() + " after unsuccessful enchant attempt by char " + activeChar.getName());
          activeChar.sendActionFailed();
          return;
        }
        Log.LogItem(activeChar, Log.EnchantItemFail, itemToEnchant);
        if(crystalId > 0)
        {
          L2ItemInstance crystalsToAdd = ItemTable.getInstance().createItem(crystalId);
          int count = (int) (itemToEnchant.getItem().getCrystalCount() * 0.87);
          if(destroyedItem.getEnchantLevel() > 3)
          {
            count += itemToEnchant.getItem().getCrystalCount() * 0.25 * (destroyedItem.getEnchantLevel() - 3);
          }
          if(count < 1)
          {
            count = 1;
          }
          crystalsToAdd.setCount(count);
          inventory.addItem(crystalsToAdd);
          Log.LogItem(activeChar, Log.Sys_GetItem, crystalsToAdd);
          activeChar.sendPacket(new EnchantResult(1, crystalsToAdd.getItemId(), count), SystemMessage.obtainItems(crystalId, count, 0));
        }
        else
        {
View Full Code Here

Examples of l2p.gameserver.model.items.PcInventory

    {
      activeChar.sendActionFailed();
      return;
    }
    PetInventory petInventory = pet.getInventory();
    PcInventory playerInventory = activeChar.getInventory();
    L2ItemInstance playerItem = playerInventory.getItemByObjectId(_objectId);
    if(playerItem == null || playerItem.getObjectId() == pet.getControlItemObjId() || PetDataTable.isPetControlItem(playerItem))
    {
      activeChar.sendActionFailed();
      return;
    }
    if(pet.getInventory().getTotalWeight() + playerItem.getItem().getWeight() * _amount >= pet.getMaxLoad())
    {
      activeChar.sendPacket(Msg.EXCEEDED_PET_INVENTORYS_WEIGHT_LIMIT);
      return;
    }
    if(!playerItem.canBeDropped(activeChar, false))
    {
      activeChar.sendActionFailed();
      return;
    }
    if(_amount >= playerItem.getCount())
    {
      playerInventory.dropItem(_objectId, playerItem.getCount(), false);
      playerItem.setCustomFlags(playerItem.getCustomFlags() | L2ItemInstance.FLAG_PET_EQUIPPED, true);
      petInventory.addItem(playerItem);
    }
    else
    {
      L2ItemInstance newPetItem = playerInventory.dropItem(_objectId, _amount, false);
      petInventory.addItem(newPetItem);
    }
    pet.sendItemList();
    pet.broadcastPetInfo();
    Log.LogItem(activeChar, pet, Log.GiveItemToPet, playerItem);
View Full Code Here

Examples of l2p.gameserver.model.items.PcInventory

    if(player == null)
    {
      return 0;
    }
    final int player_id = player.getObjectId();
    final PcInventory inv = player.getInventory();
    if(inv == null)
    {
      return 0;
    }
    ThreadConnection con = null;
    FiltredPreparedStatement st = null, st_delete = null;
    ResultSet rset = null;
    int restored_counter = 0;
    synchronized(_lock)
    {
      try
      {
        con = L2DatabaseFactory.getInstance().getConnection();
        st = con.prepareStatement("SELECT * FROM items_delayed WHERE owner_id=? AND payment_status=0");
        st.setInt(1, player_id);
        rset = st.executeQuery();
        L2ItemInstance item, newItem;
        st_delete = con.prepareStatement("UPDATE items_delayed SET payment_status=1 WHERE payment_id=?");
        while(rset.next())
        {
          final int ITEM_ID = rset.getShort("item_id");
          final long ITEM_COUNT = rset.getLong("count");
          final short ITEM_ENCHANT = rset.getShort("enchant_level");
          final int PAYMENT_ID = rset.getInt("payment_id");
          final int FLAGS = rset.getInt("flags");
          final byte ATTRIBUTE = rset.getByte("attribute");
          final int ATTRIBUTE_LEVEL = rset.getInt("attribute_level");
          boolean stackable = ItemTable.getInstance().getTemplate(ITEM_ID).isStackable();
          boolean success = false;
          for(int i = 0; i < (stackable ? 1 : ITEM_COUNT); i++)
          {
            item = ItemTable.getInstance().createItem(ITEM_ID);
            if(item.isStackable())
            {
              item.setCount(ITEM_COUNT);
            }
            else
            {
              item.setEnchantLevel(ITEM_ENCHANT);
              item.setAttributeElement(ATTRIBUTE, ATTRIBUTE_LEVEL, true);
            }
            item.setLocation(ItemLocation.INVENTORY);
            item.setCustomFlags(FLAGS, false);
            // При нулевом количестве выдача предмета не производится
            if(ITEM_COUNT > 0)
            {
              newItem = inv.addItem(item);
              if(newItem == null)
              {
                _log.warning("Unable to delayed create item " + ITEM_ID + " request " + PAYMENT_ID);
                continue;
              }
View Full Code Here

Examples of l2p.gameserver.model.items.PcInventory

    if(activeChar.isOutOfControl() || activeChar.isActionsDisabled())
    {
      activeChar.sendActionFailed();
      return;
    }
    PcInventory inventory = activeChar.getInventory();
    L2ItemInstance itemToUnnchant = inventory.getItemByObjectId(_objectId);
    if(itemToUnnchant == null || itemToUnnchant.getAttributeElementValue() == 0 || activeChar.getPrivateStoreType() != L2Player.STORE_PRIVATE_NONE)
    {
      activeChar.sendActionFailed();
      return;
    }
View Full Code Here

Examples of l2p.gameserver.model.items.PcInventory

    if(activeChar.isOutOfControl() || activeChar.isActionsDisabled() || activeChar.isCastingNow() || activeChar.isAttackingNow())
    {
      activeChar.sendPacket(Msg.INAPPROPRIATE_ENCHANT_CONDITIONS, Msg.ActionFail);
      return;
    }
    PcInventory inventory = activeChar.getInventory();
    L2ItemInstance itemToEnchant = inventory.getItemByObjectId(_objectId);
    L2ItemInstance stone = activeChar.getEnchantScroll();
    activeChar.setEnchantScroll(null);
    if(itemToEnchant == null || stone == null)
    {
      activeChar.sendActionFailed();
      return;
    }
    if(itemToEnchant.getOwnerId() != activeChar.getObjectId())
    {
      activeChar.sendPacket(Msg.INAPPROPRIATE_ENCHANT_CONDITIONS, Msg.ActionFail);
      return;
    }
    L2Item item = itemToEnchant.getItem();
    // only weapon & armor
    if(!item.isWeapon() && !item.isArmor())
    {
      activeChar.sendPacket(Msg.INAPPROPRIATE_ENCHANT_CONDITIONS, Msg.ActionFail);
      return;
    }
    // only S80 & S84
    if(item.getCrystalType().cry != L2Item.CRYSTAL_S)
    {
      activeChar.sendPacket(Msg.INAPPROPRIATE_ENCHANT_CONDITIONS, Msg.ActionFail);
      return;
    }
    // only normal weapons & armors
    @SuppressWarnings("rawtypes")
    Enum type = item.getItemType();
    if(type == WeaponType.ETC || type == WeaponType.PET || type == ArmorType.PET || type == ArmorType.SIGIL)
    {
      activeChar.sendPacket(Msg.INAPPROPRIATE_ENCHANT_CONDITIONS, Msg.ActionFail);
      return;
    }
    if((!Config.AttributToPvpItem && item.isPvP()) || item.isUnderwear() || item.isBelt())
    {
      activeChar.sendPacket(Msg.INAPPROPRIATE_ENCHANT_CONDITIONS, Msg.ActionFail);
      return;
    }
    if(!itemToEnchant.canBeEnchanted() && !(item.isCloak() && Config.ALLOW_ATTRIBUTE_CLOAKS))
    {
      activeChar.sendPacket(Msg.INAPPROPRIATE_ENCHANT_CONDITIONS, Msg.ActionFail);
      return;
    }
    if(itemToEnchant.getLocation() != L2ItemInstance.ItemLocation.INVENTORY && itemToEnchant.getLocation() != L2ItemInstance.ItemLocation.PAPERDOLL)
    {
      activeChar.sendPacket(Msg.INAPPROPRIATE_ENCHANT_CONDITIONS, Msg.ActionFail);
      return;
    }
    if(activeChar.getPrivateStoreType() != L2Player.STORE_PRIVATE_NONE)
    {
      activeChar.sendPacket(Msg.YOU_CANNOT_ADD_ELEMENTAL_POWER_WHILE_OPERATING_A_PRIVATE_STORE_OR_PRIVATE_WORKSHOP, Msg.ActionFail);
      return;
    }
    if(itemToEnchant.isStackable() || (stone = inventory.getItemByObjectId(stone.getObjectId())) == null)
    {
      activeChar.sendActionFailed();
      return;
    }
    int itemType2 = item.getType2();
    if(itemToEnchant.getAttributeElement() != L2Item.ATTRIBUTE_NONE && itemToEnchant.getAttributeElement() != stone.getEnchantAttributeStoneElement(itemType2 == L2Item.TYPE2_SHIELD_ARMOR))
    {
      activeChar.sendPacket(Msg.ANOTHER_ELEMENTAL_POWER_HAS_ALREADY_BEEN_ADDED_THIS_ELEMENTAL_POWER_CANNOT_BE_ADDED, Msg.ActionFail);
      return;
    }
    int maxValue = itemType2 == L2Item.TYPE2_WEAPON ? 150 : 60;
    if(stone.isAttributeCrystal())
    {
      maxValue += itemType2 == L2Item.TYPE2_WEAPON ? 150 : 60;
    }
    if(itemToEnchant.getAttributeElementValue() >= maxValue)
    {
      activeChar.sendPacket(Msg.ELEMENTAL_POWER_ENCHANCER_USAGE_HAS_BEEN_CANCELLED, Msg.ActionFail);
      return;
    }
    Log.add(activeChar.getName() + "|Trying to attribute enchant|" + itemToEnchant.getItemId() + "|attribute:" + stone.getEnchantAttributeStoneElement(itemType2 == L2Item.TYPE2_SHIELD_ARMOR) + "|" + itemToEnchant.getObjectId(), "enchants");
    L2ItemInstance removedStone;
    synchronized(inventory)
    {
      removedStone = inventory.destroyItem(stone.getObjectId(), 1, true);
    }
    if(removedStone == null)
    {
      activeChar.sendActionFailed();
      return;
    }
    if(Rnd.chance(stone.isAttributeCrystal() ? Config.ENCHANT_ATTRIBUTE_CRYSTAL_CHANCE : Config.ENCHANT_ATTRIBUTE_STONE_CHANCE))
    {
      if(itemToEnchant.getEnchantLevel() == 0)
      {
        SystemMessage sm = new SystemMessage(SystemMessage.S2_ELEMENTAL_POWER_HAS_BEEN_ADDED_SUCCESSFULLY_TO_S1);
        sm.addItemName(itemToEnchant.getItemId());
        sm.addItemName(stone.getItemId());
        activeChar.sendPacket(sm);
      }
      else
      {
        SystemMessage sm = new SystemMessage(SystemMessage.S3_ELEMENTAL_POWER_HAS_BEEN_ADDED_SUCCESSFULLY_TO__S1S2);
        sm.addNumber(itemToEnchant.getEnchantLevel());
        sm.addItemName(itemToEnchant.getItemId());
        sm.addItemName(stone.getItemId());
        activeChar.sendPacket(sm);
      }
      int value = itemType2 == L2Item.TYPE2_WEAPON ? 5 : 6;
      // Для оружия 1й камень дает +20 атрибута
      if(itemToEnchant.getAttributeElementValue() == 0 && itemType2 == L2Item.TYPE2_WEAPON)
      {
        value = 20;
      }
      itemToEnchant.setAttributeElement(stone.getEnchantAttributeStoneElement(itemType2 == L2Item.TYPE2_SHIELD_ARMOR), itemToEnchant.getAttributeElementValue() + value, true);
      inventory.refreshListeners();
      activeChar.sendPacket(new InventoryUpdate().addModifiedItem(itemToEnchant));
      Log.add(activeChar.getName() + "|Successfully enchanted by attribute|" + itemToEnchant.getItemId() + "|to+" + itemToEnchant.getAttributeElementValue() + "|" + (stone.isAttributeCrystal() ? Config.ENCHANT_ATTRIBUTE_CRYSTAL_CHANCE : Config.ENCHANT_ATTRIBUTE_STONE_CHANCE), "enchants");
      Log.LogItem(activeChar, Log.EnchantItem, itemToEnchant);
    }
    else
View Full Code Here

Examples of l2p.gameserver.model.items.PcInventory

    L2Player activeChar = getClient().getActiveChar();
    if(activeChar == null || _items == null || !activeChar.getPlayerAccess().UseWarehouse)
    {
      return;
    }
    PcInventory inventory = activeChar.getInventory();
    long adenaDeposit = 0;
    int adenaObjId;
    L2ItemInstance adena = inventory.getItemByItemId(57);
    if(adena != null)
    {
      adenaObjId = adena.getObjectId();
    }
    else
    {
      adenaObjId = -1;
    }
    for(Integer itemObjectId : _items.keySet())
    {
      L2ItemInstance item = inventory.getItemByObjectId(itemObjectId);
      if(item == null || item.isEquipped())
      {
        return;
      }
      if(_items.get(itemObjectId) < 0)
      {
        return;
      }
      if(itemObjectId == adenaObjId)
      {
        adenaDeposit = _items.get(itemObjectId);
      }
    }
    L2NpcInstance freighter = activeChar.getLastNpc();
    if(freighter == null || !activeChar.isInRange(freighter.getLoc(), L2Character.INTERACTION_DISTANCE))
    {
      activeChar.sendPacket(Msg.YOU_FAILED_AT_SENDING_THE_PACKAGE_BECAUSE_YOU_ARE_TOO_FAR_FROM_THE_WAREHOUSE);
      return;
    }
    int fee = _items.size() * _FREIGHT_FEE;
    if(fee + adenaDeposit > activeChar.getAdena())
    {
      activeChar.sendPacket(Msg.YOU_LACK_THE_FUNDS_NEEDED_TO_PAY_FOR_THIS_TRANSACTION);
      return;
    }
    Warehouse warehouse = new PcFreight(_objectID);
    // Item Max Limit Check
    if(_items.size() + warehouse.listItems(ItemClass.ALL).length > activeChar.getFreightLimit())
    {
      activeChar.sendPacket(Msg.THE_CAPACITY_OF_THE_WAREHOUSE_HAS_BEEN_EXCEEDED);
      return;
    }
    // Transfer the items from activeChar's Inventory Instance to destChar's Freight Instance
    for(Integer itemObjectId : _items.keySet())
    {
      L2ItemInstance found = inventory.getItemByObjectId(itemObjectId);
      if(found == null || !found.canBeDropped(activeChar, false))
      {
        continue;
      }
      warehouse.addItem(inventory.dropItem(found, _items.get(itemObjectId), false), null);
    }
    activeChar.reduceAdena(fee, true);
    activeChar.updateStats();
    // Delete destination L2Player used for freight
    activeChar.sendPacket(Msg.THE_TRANSACTION_IS_COMPLETE);
View Full Code Here

Examples of lineage2.gameserver.model.items.PcInventory

    }
    if (!player.getAccountChars().containsKey(_objectId))
    {
      return;
    }
    PcInventory inventory = player.getInventory();
    PcFreight freight = new PcFreight(_objectId);
    freight.restore();
    inventory.writeLock();
    freight.writeLock();
    try
    {
      int slotsleft = 0;
      long adenaDeposit = 0;
      slotsleft = Config.FREIGHT_SLOTS - freight.getSize();
      int items = 0;
      for (int i = 0; i < _count; i++)
      {
        ItemInstance item = inventory.getItemByObjectId(_items[i]);
        if ((item == null) || (item.getCount() < _itemQ[i]) || !item.getTemplate().isFreightable())
        {
          _items[i] = 0;
          _itemQ[i] = 0L;
          continue;
        }
        if (!item.isStackable() || (freight.getItemByItemId(item.getItemId()) == null))
        {
          if (slotsleft <= 0)
          {
            _items[i] = 0;
            _itemQ[i] = 0L;
            continue;
          }
          slotsleft--;
        }
        if (item.getItemId() == ItemTemplate.ITEM_ID_ADENA)
        {
          adenaDeposit = _itemQ[i];
        }
        items++;
      }
      if (slotsleft <= 0)
      {
        player.sendPacket(SystemMsg.YOU_HAVE_EXCEEDED_THE_QUANTITY_THAT_CAN_BE_INPUTTED);
      }
      if (items == 0)
      {
        player.sendPacket(SystemMsg.INCORRECT_ITEM_COUNT);
        return;
      }
      long fee = SafeMath.mulAndCheck(items, _FREIGHT_FEE);
      if ((fee + adenaDeposit) > player.getAdena())
      {
        player.sendPacket(SystemMsg.YOU_LACK_THE_FUNDS_NEEDED_TO_PAY_FOR_THIS_TRANSACTION);
        return;
      }
      if (!player.reduceAdena(fee, true))
      {
        player.sendPacket(SystemMsg.YOU_DO_NOT_HAVE_ENOUGH_ADENA);
        return;
      }
      for (int i = 0; i < _count; i++)
      {
        if (_items[i] == 0)
        {
          continue;
        }
        ItemInstance item = inventory.removeItemByObjectId(_items[i], _itemQ[i]);
        Log.LogItem(player, Log.FreightDeposit, item);
        freight.addItem(item);
      }
    }
    catch (ArithmeticException ae)
    {
      player.sendPacket(SystemMsg.YOU_HAVE_EXCEEDED_THE_QUANTITY_THAT_CAN_BE_INPUTTED);
      return;
    }
    finally
    {
      freight.writeUnlock();
      inventory.writeUnlock();
    }
    player.sendChanges();
    player.sendPacket(SystemMsg.THE_TRANSACTION_IS_COMPLETE);
  }
View Full Code Here

Examples of lineage2.gameserver.model.items.PcInventory

    Player activeChar = (getClient()).getActiveChar();
    if (activeChar == null)
    {
      return;
    }
    PcInventory inventory = activeChar.getInventory();
    ItemInstance _item = inventory.getItemByObjectId(_itemObjId);
    ItemFunctions.removeItem(activeChar, _consumeItemId, 1, true);
    boolean equipped = _item.isEquipped();
    if (equipped)
    {
      activeChar.getInventory().isRefresh = true;
View Full Code Here

Examples of lineage2.gameserver.model.items.PcInventory

   
    final boolean keepenchant = list1.isKeepEnchant();
    final boolean notax = list1.isNoTax();
    final List<ItemData> items = new ArrayList<>();
   
    PcInventory inventory = activeChar.getInventory();
   
    long totalPrice = 0;
   
    NpcInstance merchant = activeChar.getLastNpc();
    Castle castle = merchant != null ? merchant.getCastle(activeChar) : null;
   
    inventory.writeLock();
    try
    {
      long tax = SafeMath.mulAndCheck(entry.getTax(), _amount);
     
      long slots = 0;
      long weight = 0;
      for (MultiSellIngredient i : entry.getProduction())
      {
        if (i.getItemId() <= 0)
        {
          continue;
        }
        ItemTemplate item = ItemHolder.getInstance().getTemplate(i.getItemId());
       
        weight = SafeMath.addAndCheck(weight, SafeMath.mulAndCheck(SafeMath.mulAndCheck(i.getItemCount(), _amount), item.getWeight()));
        if (item.isStackable())
        {
          if (inventory.getItemByItemId(i.getItemId()) == null)
          {
            slots++;
          }
        }
        else
        {
          slots = SafeMath.addAndCheck(slots, _amount);
        }
      }
     
      if (!inventory.validateWeight(weight))
      {
        activeChar.sendPacket(Msg.YOU_HAVE_EXCEEDED_THE_WEIGHT_LIMIT);
        activeChar.sendActionFailed();
        return;
      }
     
      if (!inventory.validateCapacity(slots))
      {
        activeChar.sendPacket(Msg.YOUR_INVENTORY_IS_FULL);
        activeChar.sendActionFailed();
        return;
      }
     
      if (entry.getIngredients().size() == 0)
      {
        activeChar.sendActionFailed();
        activeChar.setMultisell(null);
        return;
      }
     
      for (MultiSellIngredient ingridient : entry.getIngredients())
      {
        int ingridientItemId = ingridient.getItemId();
        long ingridientItemCount = ingridient.getItemCount();
        int ingridientEnchant = ingridient.getItemEnchant();
        long totalAmount = !ingridient.getMantainIngredient() ? SafeMath.mulAndCheck(ingridientItemCount, _amount) : ingridientItemCount;
       
        if (ingridientItemId == ItemTemplate.ITEM_ID_CLAN_REPUTATION_SCORE)
        {
          if (activeChar.getClan() == null)
          {
            activeChar.sendPacket(Msg.YOU_ARE_NOT_A_CLAN_MEMBER);
            return;
          }
         
          if (activeChar.getClan().getReputationScore() < totalAmount)
          {
            activeChar.sendPacket(Msg.THE_CLAN_REPUTATION_SCORE_IS_TOO_LOW);
            return;
          }
         
          if (activeChar.getClan().getLeaderId() != activeChar.getObjectId())
          {
            activeChar.sendPacket(new SystemMessage(SystemMessage.S1_IS_NOT_A_CLAN_LEADER).addString(activeChar.getName()));
            return;
          }
          if (!ingridient.getMantainIngredient())
          {
            items.add(new ItemData(ingridientItemId, totalAmount, null));
          }
        }
        else if (ingridientItemId == ItemTemplate.ITEM_ID_PC_BANG_POINTS)
        {
          if (activeChar.getPcBangPoints() < totalAmount)
          {
            activeChar.sendPacket(Msg.YOU_ARE_SHORT_OF_ACCUMULATED_POINTS);
            return;
          }
          if (!ingridient.getMantainIngredient())
          {
            items.add(new ItemData(ingridientItemId, totalAmount, null));
          }
        }
        else if (ingridientItemId == ItemTemplate.ITEM_ID_FAME)
        {
          if (activeChar.getFame() < totalAmount)
          {
            activeChar.sendPacket(Msg.NOT_ENOUGH_FAME_POINTS);
            return;
          }
          if (!ingridient.getMantainIngredient())
          {
            items.add(new ItemData(ingridientItemId, totalAmount, null));
          }
        }
        else
        {
          ItemTemplate template = ItemHolder.getInstance().getTemplate(ingridientItemId);
         
          if (!template.isStackable())
          {
            for (int i = 0; i < (ingridientItemCount * _amount); i++)
            {
              List<ItemInstance> list = inventory.getItemsByItemId(ingridientItemId);
              if (keepenchant)
              {
                ItemInstance itemToTake = null;
                for (ItemInstance item : list)
                {
                  ItemData itmd = new ItemData(item.getItemId(), item.getCount(), item);
                  if (((item.getEnchantLevel() == ingridientEnchant) || !item.getTemplate().isEquipment()) && !items.contains(itmd) && item.canBeExchanged(activeChar))
                  {
                    itemToTake = item;
                    break;
                  }
                }
               
                if (itemToTake == null)
                {
                  activeChar.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_REQUIRED_ITEMS);
                  return;
                }
               
                if (!ingridient.getMantainIngredient())
                {
                  items.add(new ItemData(itemToTake.getItemId(), 1, itemToTake));
                }
              }
              else
              {
                ItemInstance itemToTake = null;
                for (ItemInstance item : list)
                {
                  if (!items.contains(new ItemData(item.getItemId(), item.getCount(), item)) && ((itemToTake == null) || (item.getEnchantLevel() < itemToTake.getEnchantLevel())) && !item.isShadowItem() && !item.isTemporalItem() && (!item.isAugmented() || Config.ALT_ALLOW_DROP_AUGMENTED) && ItemFunctions.checkIfCanDiscard(activeChar, item))
                  {
                    itemToTake = item;
                    if (itemToTake.getEnchantLevel() == 0)
                    {
                      break;
                    }
                  }
                }
               
                if (itemToTake == null)
                {
                  activeChar.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_REQUIRED_ITEMS);
                  return;
                }
               
                if (!ingridient.getMantainIngredient())
                {
                  items.add(new ItemData(itemToTake.getItemId(), 1, itemToTake));
                }
              }
            }
          }
          else
          {
            if (ingridientItemId == 57)
            {
              totalPrice = SafeMath.addAndCheck(totalPrice, SafeMath.mulAndCheck(ingridientItemCount, _amount));
            }
            ItemInstance item = inventory.getItemByItemId(ingridientItemId);
           
            if ((item == null) || (item.getCount() < totalAmount))
            {
              activeChar.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_REQUIRED_ITEMS);
              return;
            }
           
            if (!ingridient.getMantainIngredient())
            {
              items.add(new ItemData(item.getItemId(), totalAmount, item));
            }
          }
        }
       
        if (activeChar.getAdena() < totalPrice)
        {
          activeChar.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_ADENA);
          return;
        }
      }
     
      int enchantLevel = 0;
      ItemAttributes attributes = null;
      int augmentationId = 0;
      for (ItemData id : items)
      {
        long count = id.getCount();
        if (count > 0)
        {
          if (id.getId() == ItemTemplate.ITEM_ID_CLAN_REPUTATION_SCORE)
          {
            activeChar.getClan().incReputation((int) -count, false, "MultiSell");
            activeChar.sendPacket(new SystemMessage(SystemMessage.S1_POINTS_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_REPUTATION_SCORE).addNumber(count));
          }
          else if (id.getId() == ItemTemplate.ITEM_ID_PC_BANG_POINTS)
          {
            activeChar.reducePcBangPoints((int) count);
          }
          else if (id.getId() == ItemTemplate.ITEM_ID_FAME)
          {
            activeChar.setFame(activeChar.getFame() - (int) count, "MultiSell");
            activeChar.sendPacket(new SystemMessage(SystemMessage.S2_S1_HAS_DISAPPEARED).addNumber(count).addString("Fame"));
          }
          else
          {
            if (inventory.destroyItem(id.getItem(), count))
            {
              if (keepenchant && id.getItem().canBeEnchanted())
              {
                enchantLevel = id.getItem().getEnchantLevel();
                attributes = id.getItem().getAttributes();
                augmentationId = id.getItem().getAugmentationId();
              }
             
              activeChar.sendPacket(SystemMessage2.removeItems(id.getId(), count));
              continue;
            }
            return;
          }
        }
      }
     
      if ((tax > 0) && !notax)
      {
        if (castle != null)
        {
          activeChar.sendMessage(new CustomMessage("trade.HavePaidTax", activeChar).addNumber(tax));
          if ((merchant != null) && (merchant.getReflection() == ReflectionManager.DEFAULT))
          {
            castle.addToTreasury(tax, true, false);
          }
        }
      }
      double rndNum = 100.0D * Rnd.nextDouble();
      double chance = 0.0D;
      double chanceFrom = 0.0D;
      cycle1 :
      for (MultiSellIngredient in : entry.getProduction())
      {
        if (in.getItemId() <= 0)
        {
          if (in.getItemId() == ItemTemplate.ITEM_ID_CLAN_REPUTATION_SCORE)
          {
            activeChar.getClan().incReputation((int) (in.getItemCount() * _amount), false, "MultiSell");
            activeChar.sendPacket(new SystemMessage(SystemMessage.YOUR_CLAN_HAS_ADDED_1S_POINTS_TO_ITS_CLAN_REPUTATION_SCORE).addNumber(in.getItemCount() * _amount));
          }
          else if (in.getItemId() == ItemTemplate.ITEM_ID_PC_BANG_POINTS)
          {
            activeChar.addPcBangPoints((int) (in.getItemCount() * _amount), false);
          }
          else if (in.getItemId() == ItemTemplate.ITEM_ID_FAME)
          {
            activeChar.setFame(activeChar.getFame() + (int) (in.getItemCount() * _amount), "MultiSell");
          }
        }
        else if (ItemHolder.getInstance().getTemplate(in.getItemId()).isStackable())
        {
         
          long total = SafeMath.mulAndLimit(in.getItemCount(), _amount);
          if (in.getChance() >= 0)
          {
            chance = in.getChance();
           
            if ((rndNum >= chanceFrom) && (rndNum <= (chance + chanceFrom)))
            {
              ItemFunctions.addItem(activeChar, in.getItemId(), total, true);
              break;
            }
            chanceFrom += chance;
          }
          else
          {
            ItemFunctions.addItem(activeChar, in.getItemId(), total, true);
          }
         
        }
        else
        {
          for (int i = 0; i < _amount; i++)
          {
            ItemInstance product = ItemFunctions.createItem(in.getItemId());
           
            if (keepenchant && product.canBeEnchanted())
            {
              if (in.getChance() >= 0)
              {
                chance = in.getChance();             
               
                if ((rndNum >= chanceFrom) && (rndNum <= (chance + chanceFrom)))
                {
                  product.setEnchantLevel(enchantLevel);
                  if (attributes != null)
                  {
                    product.setAttributes(attributes.clone());
                  }
                  if (augmentationId != 0)
                  {
                    product.setAugmentationId(augmentationId);
                  }
                  inventory.addItem(product);
                  activeChar.sendPacket(SystemMessage2.obtainItems(product));
                  break cycle1;
                 
                }
                chanceFrom += chance;
              }
              else
              {
                product.setEnchantLevel(enchantLevel);
                if (attributes != null)
                {
                  product.setAttributes(attributes.clone());
                }
                if (augmentationId != 0)
                {
                  product.setAugmentationId(augmentationId);
                }
                inventory.addItem(product);
                activeChar.sendPacket(SystemMessage2.obtainItems(product));
              }
            }
            else
            {
              product.setEnchantLevel(in.getItemEnchant());
              product.setAttributes(in.getItemAttributes().clone());
              if (in.getChance() >= 0)
              {
                chance = in.getChance();
               
                if ((rndNum >= chanceFrom) && (rndNum <= (chance + chanceFrom)))
                {
                  ItemFunctions.addItem(activeChar, in.getItemId(), in.getItemCount(), true);
                  break;
                }
                chanceFrom += chance;
              }
              else
              {
                inventory.addItem(product);
                activeChar.sendPacket(SystemMessage2.obtainItems(product));
              }
            }
          }
        }
      }
    }
    catch (ArithmeticException ae)
    {
      sendPacket(Msg.YOU_HAVE_EXCEEDED_THE_QUANTITY_THAT_CAN_BE_INPUTTED);
      return;
    }
    finally
    {
      inventory.writeUnlock();
    }
   
    activeChar.sendChanges();
   
    if (!list1.isShowAll())
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.