root/trunk/AE-go_GameServer/src/com/aionemu/gameserver/services/ItemService.java

993999
26
import com.aionemu.gameserver.dao.ItemStoneListDAO;
26
import com.aionemu.gameserver.dao.ItemStoneListDAO;
27
import com.aionemu.gameserver.dataholders.DataManager;
27
import com.aionemu.gameserver.dataholders.DataManager;
28
import com.aionemu.gameserver.model.gameobjects.Item;
28
import com.aionemu.gameserver.model.gameobjects.Item;
29
import com.aionemu.gameserver.model.gameobjects.PersistentState;
29
import com.aionemu.gameserver.model.gameobjects.player.Storage;
30
import com.aionemu.gameserver.model.gameobjects.player.Storage;
30
import com.aionemu.gameserver.model.gameobjects.player.Player;
31
import com.aionemu.gameserver.model.gameobjects.player.Player;
31
import com.aionemu.gameserver.model.gameobjects.player.StorageType;
32
import com.aionemu.gameserver.model.gameobjects.player.StorageType;
...
...
185
186
186
187
187
		Item newItem = newItem(itemToSplit.getItemTemplate().getItemId(), splitAmount);
188
		Item newItem = newItem(itemToSplit.getItemTemplate().getItemId(), splitAmount);
188
189
		if(destinationStorage.putToBag(newItem) != null)
189
		if(destinationStorage.putToBag(newItem) != null)
190
		{
190
		{
191
			itemToSplit.decreaseItemCount(splitAmount);
191
			itemToSplit.decreaseItemCount(splitAmount);
...
...
421
			else
421
			else
422
			{
422
			{
423
				item.setItemCount(count);
423
				item.setItemCount(count);
424
				sourceStorage.removeFromBag(item, true);
424
				sourceStorage.removeFromBag(item, false);
425
				sendDeleteItemPacket(player, sourceStorageType, item.getObjectId());
425
				sendDeleteItemPacket(player, sourceStorageType, item.getObjectId());
426
427
				Item newitem = destinationStorage.putToBag(item);
426
				Item newitem = destinationStorage.putToBag(item);
428
				sendStorageUpdatePacket(player, destinationStorageType, newitem);
427
				sendStorageUpdatePacket(player, destinationStorageType, newitem);
429
428
...
...
431
			}
430
			}
432
		}
431
		}
433
432
433
		if(count > 0) // if storage is full and some items left
434
		{
435
			item.setItemCount(count);
436
			sendUpdateItemPacket(player, sourceStorageType, item);
437
		}
438
434
	}
439
	}
435
440
436
441