Package net.sf.l2j.gameserver.datatables

Examples of net.sf.l2j.gameserver.datatables.ItemTable$resetOwner


  {
    Inventory playersInv = player.getInventory();
    Inventory recieverInv = reciever.getInventory();
    L2ItemInstance playerItem,recieverItem,temp,newitem;
    InventoryUpdate update = new InventoryUpdate();
    ItemTable itemTable = ItemTable.getInstance();

    //boolean isValid;
    //LinkedList<L2ItemInstance> itemsToAdd = new LinkedList<L2ItemInstance>();
    //LinkedList<L2ItemInstance> itemsToRemove = new LinkedList<L2ItemInstance>();
    //LinkedList countsToRemove = new LinkedList();

    for(int y = 0 ; y < _items.size(); y++)
    {
      temp = _items.get(y);
      playerItem = playersInv.getItemByObjectId(temp.getObjectId());
      // FIXME: why is this null??
            if (playerItem == null)
                continue;
            newitem = itemTable.createItem("L2TradeList", playerItem.getItemId(), playerItem.getCount(), player);
      newitem.setEnchantLevel(temp.getEnchantLevel());

            // DIRTY FIX: Fix for trading pet collar not updating pet with new collar object id
            changePetItemObjectId(playerItem.getObjectId(), newitem.getObjectId());
View Full Code Here


        int enchantLevel            = 0;

    InventoryUpdate buyerupdate     = new InventoryUpdate();
        InventoryUpdate sellerupdate    = new InventoryUpdate();

    ItemTable itemTable = ItemTable.getInstance();

    int amount = 0;
    int x = 0;
    int y = 0;

    List<SystemMessage> sysmsgs = new FastList<SystemMessage>();
    SystemMessage msg = null;

    for(TradeItem buyerItem : buyerslist)
    {
        for(x=0 ; x < sellerslist.size(); x++)//find in sellerslist
        {
            temp2 = sellerslist.get(x);
            if (temp2.getItemId() == buyerItem.getItemId())
            {
                sellerItem = sellerInv.getItemByItemId(buyerItem.getItemId());
                break;
            }
        }

        if (sellerItem !=null)
        {
            if (buyerItem.getCount()> temp2.getCount())
            {
                amount = temp2.getCount();
            }
            if (buyerItem.getCount()> sellerItem.getCount())
            {
                amount = sellerItem.getCount();
            }
            else
            {
                amount = buyerItem.getCount();
            }
                if (buyerItem.getCount() > Integer.MAX_VALUE / buyerItem.getOwnersPrice())
                {
                    _log.warning("Integer Overflow on Cost. Possible Exploit attempt between "+buyer.getName()+" and "+seller.getName()+".");
                    return;
                }
                //int cost = amount * buyerItem.getOwnersPrice();
                enchantLevel = sellerItem.getEnchantLevel();
            sellerItem = sellerInv.destroyItem("", sellerItem.getObjectId(),amount, null, null);
//            buyer.reduceAdena(cost);
//            seller.addAdena(cost);
            newitem = itemTable.createItem("L2TradeList", sellerItem.getItemId(), amount, buyer, seller);
                newitem.setEnchantLevel(enchantLevel);
            temp = buyerInv.addItem("", newitem, null, null);
            if (amount == 1)//system msg stuff
            {
                msg = new SystemMessage(SystemMessageId.S1_PURCHASED_S2);
View Full Code Here

    newChar.registerShortCut(shortcut);
    //add sit shortcut
    shortcut = new L2ShortCut(10,0,3,0,-1,1);
    newChar.registerShortCut(shortcut);

    ItemTable itemTable = ItemTable.getInstance();
    L2Item[] items = template.getItems();
    for (int i = 0; i < items.length; i++)
    {
      L2ItemInstance item = newChar.getInventory().addItem("Init", items[i].getItemId(), 1, newChar, null);
      if (item.getItemId()==5588){
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.datatables.ItemTable$resetOwner

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.