Показать сообщение отдельно
Непрочитано 18.02.2012, 09:25   #192
Аватар для ALF.
Герой

По умолчанию Re: Работа над Goddess of Destruction (part 5)

WareHouseDepositList 415 протокол
PHP код:
package l2p.gameserver.network.serverpackets;

import l2p.commons.lang.ArrayUtils;
import l2p.gameserver.model.Player;
import l2p.gameserver.model.items.ItemInfo;
import l2p.gameserver.model.items.ItemInstance;
import l2p.gameserver.model.items.Warehouse.ItemClassComparator;
import l2p.gameserver.model.items.Warehouse.WarehouseType;

import java.util.ArrayList;
import java.util.List;


/**
 * @author    ALF
 * @data    10.02.2012
 */
public class WareHouseDepositList extends L2GameServerPacket {
    private 
int _whtype;
    private 
long _adena;
    private List<
ItemInfo_itemList;

    public 
WareHouseDepositList(Player chaWarehouseType whtype) {
        
_whtype whtype.ordinal();
        
_adena cha.getAdena();

        
ItemInstance[] items cha.getInventory().getItems();
        
ArrayUtils.eqSort(itemsItemClassComparator.getInstance());
        
_itemList = new ArrayList<ItemInfo>(items.length);
        for (
ItemInstance item items)
            if (
item.canBeStored(cha_whtype == 1))
                
_itemList.add(new ItemInfo(item));
    }

    @
Override
    
protected final void writeImpl() {
        
writeC(0x41);
        
writeH(_whtype);
        
writeQ(_adena);
        
writeD(0); // кол занятых слотов
        
writeH(0/*size*/); // Кол. Валюты в ВХ
        //for (size)  
        //    writeD(ItemId);
        //   
        
writeH(_itemList.size());
        for (
ItemInfo item _itemList) {
            
writeItemInfo(item);
            
writeD(item.getObjectId());
        }
    }

WareHouseDepositList 415 протокол
ALF. вне форума Отправить сообщение для ALF. с помощью ICQ Отправить сообщение для ALF. с помощью Skype™
Сказали спасибо: