root/trunk/AE-go_GameServer/src/com/aionemu/gameserver/network/aion/clientpackets/CM_SPLIT_ITEM.java

967993
19
	private ItemService itemService;
19
	private ItemService itemService;
20
20
21
	int sourceItemObjId;
21
	int sourceItemObjId;
22
	int sourceStorageType;
22
	int itemAmount;
23
	int itemAmount;
23
	int destinationItemObjId;
24
	int destinationItemObjId;
25
	int destinationStorageType;
24
	int slotNum; // destination slot.
26
	int slotNum; // destination slot.
25
27
26
	public CM_SPLIT_ITEM(int opcode)
28
	public CM_SPLIT_ITEM(int opcode)
...
...
31
	@Override
33
	@Override
32
	protected void readImpl()
34
	protected void readImpl()
33
	{
35
	{
34
		sourceItemObjId = readD();      // drag item unique ID. If merging and itemCount becoming null, this item must be deleted.
36
		sourceItemObjId = readD();       // drag item unique ID. If merging and itemCount becoming null, this item must be deleted.
35
		itemAmount = readD();           // Items count to be moved.
37
		itemAmount = readD();            // Items count to be moved.
36
		@SuppressWarnings("unused")
38
		byte[] zeros = readB(4);         // Nothing
37
		byte[] zeros = readB(5);        // Nothing
39
		sourceStorageType = readC();     // Source storage
38
		destinationItemObjId = readD(); // Destination item unique ID if merging. Null if spliting.
40
		destinationItemObjId = readD();  // Destination item unique ID if merging. Null if spliting.
39
		zeros = readB(1);               // Nothing
41
		destinationStorageType = readC();// Destination storage
40
		slotNum = readH();              // Destination slot. Not needed right now, Items adding only to next available slot. Not needed at all when merge.
42
		slotNum = readH();               // Destination slot. Not needed right now, Items adding only to next available slot. Not needed at all when merge.
41
	}
43
	}
42
44
45
43
	@Override
46
	@Override
44
	protected void runImpl()
47
	protected void runImpl()
45
	{
48
	{
46
		Player player = getConnection().getActivePlayer();
49
		Player player = getConnection().getActivePlayer();
47
50
48
		if(destinationItemObjId == 0)
51
		if(destinationItemObjId == 0)
49
			itemService.splitItem(player, sourceItemObjId, itemAmount, slotNum);
52
			itemService.splitItem(player, sourceItemObjId, itemAmount, slotNum, sourceStorageType, destinationStorageType);
50
		else
53
		else
51
			itemService.mergeItems(player, sourceItemObjId, itemAmount, destinationItemObjId);
54
			itemService.mergeItems(player, sourceItemObjId, itemAmount, destinationItemObjId, sourceStorageType, destinationStorageType);
52
	}
55
	}
53
}
56
}