Przeglądaj źródła

Created new enums ItemType1 and ItemType2 and removed all static arrays
related to them from L2Item

Adry85 7 lat temu
rodzic
commit
0d529a0b63
23 zmienionych plików z 228 dodań i 102 usunięć
  1. 4 2
      src/main/java/com/l2jserver/gameserver/datatables/ItemTable.java
  2. 3 2
      src/main/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
  3. 6 4
      src/main/java/com/l2jserver/gameserver/model/items/L2Armor.java
  4. 6 4
      src/main/java/com/l2jserver/gameserver/model/items/L2EtcItem.java
  5. 15 23
      src/main/java/com/l2jserver/gameserver/model/items/L2Item.java
  6. 4 2
      src/main/java/com/l2jserver/gameserver/model/items/L2WarehouseItem.java
  7. 4 2
      src/main/java/com/l2jserver/gameserver/model/items/L2Weapon.java
  8. 4 3
      src/main/java/com/l2jserver/gameserver/model/items/enchant/AbstractEnchantItem.java
  9. 4 2
      src/main/java/com/l2jserver/gameserver/model/items/instance/L2ItemInstance.java
  10. 43 0
      src/main/java/com/l2jserver/gameserver/model/items/type/ItemType1.java
  11. 46 0
      src/main/java/com/l2jserver/gameserver/model/items/type/ItemType2.java
  12. 6 4
      src/main/java/com/l2jserver/gameserver/network/clientpackets/RequestDropItem.java
  13. 4 2
      src/main/java/com/l2jserver/gameserver/network/clientpackets/UseItem.java
  14. 1 1
      src/main/java/com/l2jserver/gameserver/network/serverpackets/AbstractItemPacket.java
  15. 2 2
      src/main/java/com/l2jserver/gameserver/network/serverpackets/BuyList.java
  16. 1 1
      src/main/java/com/l2jserver/gameserver/network/serverpackets/ExRpItemLink.java
  17. 2 2
      src/main/java/com/l2jserver/gameserver/network/serverpackets/MultiSellList.java
  18. 2 2
      src/main/java/com/l2jserver/gameserver/network/serverpackets/SellList.java
  19. 2 2
      src/main/java/com/l2jserver/gameserver/network/serverpackets/SellListProcure.java
  20. 3 3
      src/main/java/com/l2jserver/gameserver/network/serverpackets/ShopPreviewList.java
  21. 64 37
      src/main/java/com/l2jserver/gameserver/network/serverpackets/SortedWareHouseWithdrawalList.java
  22. 1 1
      src/main/java/com/l2jserver/gameserver/network/serverpackets/TradeOtherAdd.java
  23. 1 1
      src/main/java/com/l2jserver/gameserver/network/serverpackets/TradeOwnAdd.java

+ 4 - 2
src/main/java/com/l2jserver/gameserver/datatables/ItemTable.java

@@ -196,8 +196,10 @@ public class ItemTable
 	}
 	
 	/**
-	 * Create the L2ItemInstance corresponding to the Item Identifier and quantitiy add logs the activity. <B><U> Actions</U> :</B> <li>Create and Init the L2ItemInstance corresponding to the Item Identifier and quantity</li> <li>Add the L2ItemInstance object to _allObjects of L2world</li> <li>Logs
-	 * Item creation according to log settings</li>
+	 * Create the L2ItemInstance corresponding to the Item Identifier and quantitiy add logs the activity. <B><U> Actions</U> :</B>
+	 * <li>Create and Init the L2ItemInstance corresponding to the Item Identifier and quantity</li>
+	 * <li>Add the L2ItemInstance object to _allObjects of L2world</li>
+	 * <li>Logs Item creation according to log settings</li>
 	 * @param process : String Identifier of process triggering this action
 	 * @param itemId : int Item Identifier of the item to be created
 	 * @param count : int Quantity of items to be created for stackable items

+ 3 - 2
src/main/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -226,6 +226,7 @@ import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
 import com.l2jserver.gameserver.model.items.type.ActionType;
 import com.l2jserver.gameserver.model.items.type.ArmorType;
 import com.l2jserver.gameserver.model.items.type.EtcItemType;
+import com.l2jserver.gameserver.model.items.type.ItemType2;
 import com.l2jserver.gameserver.model.items.type.WeaponType;
 import com.l2jserver.gameserver.model.multisell.PreparedListContainer;
 import com.l2jserver.gameserver.model.olympiad.OlympiadGameManager;
@@ -5368,7 +5369,7 @@ public final class L2PcInstance extends L2Playable
 					if (itemDrop.isShadowItem() || // Dont drop Shadow Items
 						itemDrop.isTimeLimitedItem() || // Dont drop Time Limited Items
 						!itemDrop.isDropable() || (itemDrop.getId() == Inventory.ADENA_ID) || // Adena
-						(itemDrop.getItem().getType2() == L2Item.TYPE2_QUEST) || // Quest Items
+						(itemDrop.getItem().getType2() == ItemType2.QUEST) || // Quest Items
 						(hasSummon() && (getSummon().getControlObjectId() == itemDrop.getId())) || // Control Item of active pet
 						(Arrays.binarySearch(Config.KARMA_LIST_NONDROPPABLE_ITEMS, itemDrop.getId()) >= 0) || // Item listed in the non droppable item list
 						(Arrays.binarySearch(Config.KARMA_LIST_NONDROPPABLE_PET_ITEMS, itemDrop.getId()) >= 0 // Item listed in the non droppable pet item list
@@ -5380,7 +5381,7 @@ public final class L2PcInstance extends L2Playable
 					if (itemDrop.isEquipped())
 					{
 						// Set proper chance according to Item type of equipped Item
-						itemDropPercent = itemDrop.getItem().getType2() == L2Item.TYPE2_WEAPON ? dropEquipWeapon : dropEquip;
+						itemDropPercent = itemDrop.getItem().getType2() == ItemType2.WEAPON ? dropEquipWeapon : dropEquip;
 						getInventory().unEquipItemInSlot(itemDrop.getLocationSlot());
 					}
 					else

+ 6 - 4
src/main/java/com/l2jserver/gameserver/model/items/L2Armor.java

@@ -21,6 +21,8 @@ package com.l2jserver.gameserver.model.items;
 import com.l2jserver.gameserver.model.StatsSet;
 import com.l2jserver.gameserver.model.holders.SkillHolder;
 import com.l2jserver.gameserver.model.items.type.ArmorType;
+import com.l2jserver.gameserver.model.items.type.ItemType1;
+import com.l2jserver.gameserver.model.items.type.ItemType2;
 import com.l2jserver.gameserver.model.skills.Skill;
 import com.l2jserver.util.StringUtil;
 
@@ -47,8 +49,8 @@ public final class L2Armor extends L2Item
 		int _bodyPart = getBodyPart();
 		if ((_bodyPart == L2Item.SLOT_NECK) || ((_bodyPart & L2Item.SLOT_L_EAR) != 0) || ((_bodyPart & L2Item.SLOT_L_FINGER) != 0) || ((_bodyPart & L2Item.SLOT_R_BRACELET) != 0) || ((_bodyPart & L2Item.SLOT_L_BRACELET) != 0))
 		{
-			_type1 = L2Item.TYPE1_WEAPON_RING_EARRING_NECKLACE;
-			_type2 = L2Item.TYPE2_ACCESSORY;
+			_type1 = ItemType1.WEAPON_RING_EARRING_NECKLACE;
+			_type2 = ItemType2.ACCESSORY;
 		}
 		else
 		{
@@ -56,8 +58,8 @@ public final class L2Armor extends L2Item
 			{
 				_type = ArmorType.SHIELD;
 			}
-			_type1 = L2Item.TYPE1_SHIELD_ARMOR;
-			_type2 = L2Item.TYPE2_SHIELD_ARMOR;
+			_type1 = ItemType1.SHIELD_ARMOR;
+			_type2 = ItemType2.SHIELD_ARMOR;
 		}
 		
 		String skill = set.getString("enchant4_skill", null);

+ 6 - 4
src/main/java/com/l2jserver/gameserver/model/items/L2EtcItem.java

@@ -25,6 +25,8 @@ import com.l2jserver.gameserver.model.L2ExtractableProduct;
 import com.l2jserver.gameserver.model.StatsSet;
 import com.l2jserver.gameserver.model.itemcontainer.Inventory;
 import com.l2jserver.gameserver.model.items.type.EtcItemType;
+import com.l2jserver.gameserver.model.items.type.ItemType1;
+import com.l2jserver.gameserver.model.items.type.ItemType2;
 import com.l2jserver.util.StringUtil;
 
 /**
@@ -59,16 +61,16 @@ public final class L2EtcItem extends L2Item
 			}
 		}
 		
-		_type1 = L2Item.TYPE1_ITEM_QUESTITEM_ADENA;
-		_type2 = L2Item.TYPE2_OTHER; // default is other
+		_type1 = ItemType1.ITEM_QUESTITEM_ADENA;
+		_type2 = ItemType2.OTHER; // default is other
 		
 		if (isQuestItem())
 		{
-			_type2 = L2Item.TYPE2_QUEST;
+			_type2 = ItemType2.QUEST;
 		}
 		else if ((getId() == Inventory.ADENA_ID) || (getId() == Inventory.ANCIENT_ADENA_ID))
 		{
-			_type2 = L2Item.TYPE2_MONEY;
+			_type2 = ItemType2.MONEY;
 		}
 		
 		_handler = set.getString("handler", null); // ! null !

+ 15 - 23
src/main/java/com/l2jserver/gameserver/model/items/L2Item.java

@@ -42,6 +42,8 @@ import com.l2jserver.gameserver.model.items.type.ActionType;
 import com.l2jserver.gameserver.model.items.type.CrystalType;
 import com.l2jserver.gameserver.model.items.type.EtcItemType;
 import com.l2jserver.gameserver.model.items.type.ItemType;
+import com.l2jserver.gameserver.model.items.type.ItemType1;
+import com.l2jserver.gameserver.model.items.type.ItemType2;
 import com.l2jserver.gameserver.model.items.type.MaterialType;
 import com.l2jserver.gameserver.model.skills.Skill;
 import com.l2jserver.gameserver.model.stats.functions.AbstractFunction;
@@ -63,17 +65,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
 {
 	protected static final Logger _log = Logger.getLogger(L2Item.class.getName());
 	
-	public static final int TYPE1_WEAPON_RING_EARRING_NECKLACE = 0;
-	public static final int TYPE1_SHIELD_ARMOR = 1;
-	public static final int TYPE1_ITEM_QUESTITEM_ADENA = 4;
-	
-	public static final int TYPE2_WEAPON = 0;
-	public static final int TYPE2_SHIELD_ARMOR = 1;
-	public static final int TYPE2_ACCESSORY = 2;
-	public static final int TYPE2_QUEST = 3;
-	public static final int TYPE2_MONEY = 4;
-	public static final int TYPE2_OTHER = 5;
-	
 	public static final int SLOT_NONE = 0x0000;
 	public static final int SLOT_UNDERWEAR = 0x0001;
 	public static final int SLOT_R_EAR = 0x0002;
@@ -144,8 +135,8 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
 	private final int _defaultEnchantLevel;
 	private final ActionType _defaultAction;
 	
-	protected int _type1; // needed for item list (inventory)
-	protected int _type2; // different lists for armor, weapon, etc
+	protected ItemType1 _type1; // needed for item list (inventory)
+	protected ItemType2 _type2; // different lists for armor, weapon, etc
 	protected Elementals[] _elementals = null;
 	protected List<FuncTemplate> _funcTemplates;
 	protected List<Condition> _preConditions;
@@ -273,7 +264,8 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
 		
 		_common = ((_itemId >= 11605) && (_itemId <= 12361));
 		_heroItem = ((_itemId >= 6611) && (_itemId <= 6621)) || ((_itemId >= 9388) && (_itemId <= 9390)) || (_itemId == 6842);
-		_pvpItem = ((_itemId >= 10667) && (_itemId <= 10835)) || ((_itemId >= 12852) && (_itemId <= 12977)) || ((_itemId >= 14363) && (_itemId <= 14525)) || (_itemId == 14528) || (_itemId == 14529) || (_itemId == 14558) || ((_itemId >= 15913) && (_itemId <= 16024)) || ((_itemId >= 16134) && (_itemId <= 16147)) || (_itemId == 16149) || (_itemId == 16151) || (_itemId == 16153) || (_itemId == 16155) || (_itemId == 16157) || (_itemId == 16159) || ((_itemId >= 16168) && (_itemId <= 16176)) || ((_itemId >= 16179) && (_itemId <= 16220));
+		_pvpItem = ((_itemId >= 10667) && (_itemId <= 10835)) || ((_itemId >= 12852) && (_itemId <= 12977)) || ((_itemId >= 14363) && (_itemId <= 14525)) || (_itemId == 14528) || (_itemId == 14529) || (_itemId == 14558) || ((_itemId >= 15913) && (_itemId <= 16024))
+			|| ((_itemId >= 16134) && (_itemId <= 16147)) || (_itemId == 16149) || (_itemId == 16151) || (_itemId == 16153) || (_itemId == 16155) || (_itemId == 16157) || (_itemId == 16159) || ((_itemId >= 16168) && (_itemId <= 16176)) || ((_itemId >= 16179) && (_itemId <= 16220));
 	}
 	
 	/**
@@ -357,9 +349,9 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
 	
 	/**
 	 * Returns the type 2 of the item
-	 * @return int
+	 * @return ItemType2
 	 */
-	public final int getType2()
+	public final ItemType2 getType2()
 	{
 		return _type2;
 	}
@@ -446,10 +438,10 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
 		{
 			switch (_type2)
 			{
-				case TYPE2_SHIELD_ARMOR:
-				case TYPE2_ACCESSORY:
+				case SHIELD_ARMOR:
+				case ACCESSORY:
 					return _crystalCount + (getCrystalType().getCrystalEnchantBonusArmor() * ((3 * enchantLevel) - 6));
-				case TYPE2_WEAPON:
+				case WEAPON:
 					return _crystalCount + (getCrystalType().getCrystalEnchantBonusWeapon() * ((2 * enchantLevel) - 3));
 				default:
 					return _crystalCount;
@@ -459,10 +451,10 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
 		{
 			switch (_type2)
 			{
-				case TYPE2_SHIELD_ARMOR:
-				case TYPE2_ACCESSORY:
+				case SHIELD_ARMOR:
+				case ACCESSORY:
 					return _crystalCount + (getCrystalType().getCrystalEnchantBonusArmor() * enchantLevel);
-				case TYPE2_WEAPON:
+				case WEAPON:
 					return _crystalCount + (getCrystalType().getCrystalEnchantBonusWeapon() * enchantLevel);
 				default:
 					return _crystalCount;
@@ -542,7 +534,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
 	/**
 	 * @return the type 1 of the item.
 	 */
-	public final int getType1()
+	public final ItemType1 getType1()
 	{
 		return _type1;
 	}

+ 4 - 2
src/main/java/com/l2jserver/gameserver/model/items/L2WarehouseItem.java

@@ -21,6 +21,8 @@ package com.l2jserver.gameserver.model.items;
 import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
 import com.l2jserver.gameserver.model.items.type.CrystalType;
 import com.l2jserver.gameserver.model.items.type.ItemType;
+import com.l2jserver.gameserver.model.items.type.ItemType1;
+import com.l2jserver.gameserver.model.items.type.ItemType2;
 
 /**
  * This class contains L2ItemInstance<BR>
@@ -139,7 +141,7 @@ public class L2WarehouseItem
 	/**
 	 * @return the first type.
 	 */
-	public final int getType1()
+	public final ItemType1 getType1()
 	{
 		return _item.getType1();
 	}
@@ -147,7 +149,7 @@ public class L2WarehouseItem
 	/**
 	 * @return the second type.
 	 */
-	public final int getType2()
+	public final ItemType2 getType2()
 	{
 		return _item.getType2();
 	}

+ 4 - 2
src/main/java/com/l2jserver/gameserver/model/items/L2Weapon.java

@@ -29,6 +29,8 @@ import com.l2jserver.gameserver.model.conditions.ConditionGameChance;
 import com.l2jserver.gameserver.model.events.EventDispatcher;
 import com.l2jserver.gameserver.model.events.impl.character.npc.OnNpcSkillSee;
 import com.l2jserver.gameserver.model.holders.SkillHolder;
+import com.l2jserver.gameserver.model.items.type.ItemType1;
+import com.l2jserver.gameserver.model.items.type.ItemType2;
 import com.l2jserver.gameserver.model.items.type.WeaponType;
 import com.l2jserver.gameserver.model.skills.Skill;
 import com.l2jserver.gameserver.model.stats.Formulas;
@@ -80,8 +82,8 @@ public final class L2Weapon extends L2Item
 	{
 		super(set);
 		_type = WeaponType.valueOf(set.getString("weapon_type", "none").toUpperCase());
-		_type1 = L2Item.TYPE1_WEAPON_RING_EARRING_NECKLACE;
-		_type2 = L2Item.TYPE2_WEAPON;
+		_type1 = ItemType1.WEAPON_RING_EARRING_NECKLACE;
+		_type2 = ItemType2.WEAPON;
 		_isMagicWeapon = set.getBoolean("is_magic_weapon", false);
 		_soulShotCount = set.getInt("soulshots", 0);
 		_spiritShotCount = set.getInt("spiritshots", 0);

+ 4 - 3
src/main/java/com/l2jserver/gameserver/model/items/enchant/AbstractEnchantItem.java

@@ -27,6 +27,7 @@ import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
 import com.l2jserver.gameserver.model.items.type.CrystalType;
 import com.l2jserver.gameserver.model.items.type.EtcItemType;
 import com.l2jserver.gameserver.model.items.type.ItemType;
+import com.l2jserver.gameserver.model.items.type.ItemType2;
 import com.l2jserver.gameserver.util.Util;
 
 /**
@@ -148,13 +149,13 @@ public abstract class AbstractEnchantItem
 	 * @param type2
 	 * @return {@code true} if current type2 is valid to be enchanted, {@code false} otherwise
 	 */
-	private final boolean isValidItemType(int type2)
+	private final boolean isValidItemType(ItemType2 type2)
 	{
-		if (type2 == L2Item.TYPE2_WEAPON)
+		if (type2 == ItemType2.WEAPON)
 		{
 			return isWeapon();
 		}
-		else if ((type2 == L2Item.TYPE2_SHIELD_ARMOR) || (type2 == L2Item.TYPE2_ACCESSORY))
+		else if ((type2 == ItemType2.SHIELD_ARMOR) || (type2 == ItemType2.ACCESSORY))
 		{
 			return !isWeapon();
 		}

+ 4 - 2
src/main/java/com/l2jserver/gameserver/model/items/instance/L2ItemInstance.java

@@ -70,6 +70,8 @@ import com.l2jserver.gameserver.model.items.L2Item;
 import com.l2jserver.gameserver.model.items.L2Weapon;
 import com.l2jserver.gameserver.model.items.type.EtcItemType;
 import com.l2jserver.gameserver.model.items.type.ItemType;
+import com.l2jserver.gameserver.model.items.type.ItemType1;
+import com.l2jserver.gameserver.model.items.type.ItemType2;
 import com.l2jserver.gameserver.model.options.EnchantOptions;
 import com.l2jserver.gameserver.model.options.Options;
 import com.l2jserver.gameserver.model.stats.functions.AbstractFunction;
@@ -851,8 +853,8 @@ public final class L2ItemInstance extends L2Object
 	public boolean isAvailable(L2PcInstance player, boolean allowAdena, boolean allowNonTradeable)
 	{
 		return ((!isEquipped()) // Not equipped
-			&& (getItem().getType2() != L2Item.TYPE2_QUEST) // Not Quest Item
-			&& ((getItem().getType2() != L2Item.TYPE2_MONEY) || (getItem().getType1() != L2Item.TYPE1_SHIELD_ARMOR)) // not money, not shield
+			&& (getItem().getType2() != ItemType2.QUEST) // Not Quest Item
+			&& ((getItem().getType2() != ItemType2.MONEY) || (getItem().getType1() != ItemType1.SHIELD_ARMOR)) // not money, not shield
 			&& (!player.hasSummon() || (getObjectId() != player.getSummon().getControlObjectId())) // Not Control item of currently summoned pet
 			&& (player.getActiveEnchantItemId() != getObjectId()) // Not momentarily used enchant scroll
 			&& (player.getActiveEnchantSupportItemId() != getObjectId()) // Not momentarily used enchant support item

+ 43 - 0
src/main/java/com/l2jserver/gameserver/model/items/type/ItemType1.java

@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2004-2018 L2J Server
+ * 
+ * This file is part of L2J Server.
+ * 
+ * L2J Server is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * L2J Server is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package com.l2jserver.gameserver.model.items.type;
+
+/**
+ * Item Type 1 enumerated.
+ * @author Adry_85
+ * @since 2.6.0.0
+ */
+public enum ItemType1
+{
+	WEAPON_RING_EARRING_NECKLACE(0),
+	SHIELD_ARMOR(1),
+	ITEM_QUESTITEM_ADENA(4);
+	
+	private final int _id;
+	
+	private ItemType1(int id)
+	{
+		_id = id;
+	}
+	
+	public int getId()
+	{
+		return _id;
+	}
+}

+ 46 - 0
src/main/java/com/l2jserver/gameserver/model/items/type/ItemType2.java

@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2004-2018 L2J Server
+ * 
+ * This file is part of L2J Server.
+ * 
+ * L2J Server is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * L2J Server is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package com.l2jserver.gameserver.model.items.type;
+
+/**
+ * Item Type 2 enumerated.
+ * @author Adry_85
+ * @since 2.6.0.0
+ */
+public enum ItemType2
+{
+	WEAPON(0),
+	SHIELD_ARMOR(1),
+	ACCESSORY(2),
+	QUEST(3),
+	MONEY(4),
+	OTHER(5);
+	
+	private final int _id;
+	
+	private ItemType2(int id)
+	{
+		_id = id;
+	}
+	
+	public int getId()
+	{
+		return _id;
+	}
+}

+ 6 - 4
src/main/java/com/l2jserver/gameserver/network/clientpackets/RequestDropItem.java

@@ -24,9 +24,9 @@ import com.l2jserver.gameserver.enums.PrivateStoreType;
 import com.l2jserver.gameserver.model.PcCondOverride;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.itemcontainer.Inventory;
-import com.l2jserver.gameserver.model.items.L2Item;
 import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
 import com.l2jserver.gameserver.model.items.type.EtcItemType;
+import com.l2jserver.gameserver.model.items.type.ItemType2;
 import com.l2jserver.gameserver.model.zone.ZoneId;
 import com.l2jserver.gameserver.network.SystemMessageId;
 import com.l2jserver.gameserver.network.serverpackets.InventoryUpdate;
@@ -74,7 +74,8 @@ public final class RequestDropItem extends L2GameClientPacket
 		
 		L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId);
 		
-		if ((item == null) || (_count == 0) || !activeChar.validateItemManipulation(_objectId, "drop") || (!Config.ALLOW_DISCARDITEM && !activeChar.canOverrideCond(PcCondOverride.DROP_ALL_ITEMS)) || (!item.isDropable() && !(activeChar.canOverrideCond(PcCondOverride.DROP_ALL_ITEMS) && Config.GM_TRADE_RESTRICTED_ITEMS)) || ((item.getItemType() == EtcItemType.PET_COLLAR) && activeChar.havePetInvItems()) || activeChar.isInsideZone(ZoneId.NO_ITEM_DROP))
+		if ((item == null) || (_count == 0) || !activeChar.validateItemManipulation(_objectId, "drop") || (!Config.ALLOW_DISCARDITEM && !activeChar.canOverrideCond(PcCondOverride.DROP_ALL_ITEMS))
+			|| (!item.isDropable() && !(activeChar.canOverrideCond(PcCondOverride.DROP_ALL_ITEMS) && Config.GM_TRADE_RESTRICTED_ITEMS)) || ((item.getItemType() == EtcItemType.PET_COLLAR) && activeChar.havePetInvItems()) || activeChar.isInsideZone(ZoneId.NO_ITEM_DROP))
 		{
 			activeChar.sendPacket(SystemMessageId.CANNOT_DISCARD_THIS_ITEM);
 			return;
@@ -157,7 +158,7 @@ public final class RequestDropItem extends L2GameClientPacket
 			}
 		}
 		
-		if ((L2Item.TYPE2_QUEST == item.getItem().getType2()) && !activeChar.canOverrideCond(PcCondOverride.DROP_ALL_ITEMS))
+		if ((ItemType2.QUEST == item.getItem().getType2()) && !activeChar.canOverrideCond(PcCondOverride.DROP_ALL_ITEMS))
 		{
 			if (Config.DEBUG)
 			{
@@ -216,7 +217,8 @@ public final class RequestDropItem extends L2GameClientPacket
 		if (activeChar.isGM())
 		{
 			String target = (activeChar.getTarget() != null ? activeChar.getTarget().getName() : "no-target");
-			GMAudit.auditGMAction(activeChar.getName() + " [" + activeChar.getObjectId() + "]", "Drop", target, "(id: " + dropedItem.getId() + " name: " + dropedItem.getItemName() + " objId: " + dropedItem.getObjectId() + " x: " + activeChar.getX() + " y: " + activeChar.getY() + " z: " + activeChar.getZ() + ")");
+			GMAudit.auditGMAction(activeChar.getName() + " [" + activeChar.getObjectId() + "]", "Drop", target, "(id: " + dropedItem.getId() + " name: " + dropedItem.getItemName() + " objId: " + dropedItem.getObjectId() + " x: " + activeChar.getX() + " y: " + activeChar.getY() + " z: "
+				+ activeChar.getZ() + ")");
 		}
 		
 		if ((dropedItem != null) && (dropedItem.getId() == Inventory.ADENA_ID) && (dropedItem.getCount() >= 1000000))

+ 4 - 2
src/main/java/com/l2jserver/gameserver/network/clientpackets/UseItem.java

@@ -41,6 +41,7 @@ import com.l2jserver.gameserver.model.items.L2Item;
 import com.l2jserver.gameserver.model.items.L2Weapon;
 import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
 import com.l2jserver.gameserver.model.items.type.ArmorType;
+import com.l2jserver.gameserver.model.items.type.ItemType2;
 import com.l2jserver.gameserver.model.items.type.WeaponType;
 import com.l2jserver.gameserver.model.skills.Skill;
 import com.l2jserver.gameserver.network.SystemMessageId;
@@ -122,7 +123,7 @@ public final class UseItem extends L2GameClientPacket
 			return;
 		}
 		
-		if (item.getItem().getType2() == L2Item.TYPE2_QUEST)
+		if (item.getItem().getType2() == ItemType2.QUEST)
 		{
 			activeChar.sendPacket(SystemMessageId.CANNOT_USE_QUEST_ITEMS);
 			return;
@@ -327,7 +328,8 @@ public final class UseItem extends L2GameClientPacket
 		else
 		{
 			final L2Weapon weaponItem = activeChar.getActiveWeaponItem();
-			if (((weaponItem != null) && (weaponItem.getItemType() == WeaponType.FISHINGROD)) && (((_itemId >= 6519) && (_itemId <= 6527)) || ((_itemId >= 7610) && (_itemId <= 7613)) || ((_itemId >= 7807) && (_itemId <= 7809)) || ((_itemId >= 8484) && (_itemId <= 8486)) || ((_itemId >= 8505) && (_itemId <= 8513))))
+			if (((weaponItem != null) && (weaponItem.getItemType() == WeaponType.FISHINGROD))
+				&& (((_itemId >= 6519) && (_itemId <= 6527)) || ((_itemId >= 7610) && (_itemId <= 7613)) || ((_itemId >= 7807) && (_itemId <= 7809)) || ((_itemId >= 8484) && (_itemId <= 8486)) || ((_itemId >= 8505) && (_itemId <= 8513))))
 			{
 				activeChar.getInventory().setPaperdollItem(Inventory.PAPERDOLL_LHAND, item);
 				activeChar.broadcastUserInfo();

+ 1 - 1
src/main/java/com/l2jserver/gameserver/network/serverpackets/AbstractItemPacket.java

@@ -44,7 +44,7 @@ public abstract class AbstractItemPacket extends L2GameServerPacket
 		writeD(item.getItem().getDisplayId()); // ItemId
 		writeD(item.getLocation()); // T1
 		writeQ(item.getCount()); // Quantity
-		writeH(item.getItem().getType2()); // Item Type 2 : 00-weapon, 01-shield/armor, 02-ring/earring/necklace, 03-questitem, 04-adena, 05-item
+		writeH(item.getItem().getType2().getId()); // Item Type 2 : 00-weapon, 01-shield/armor, 02-ring/earring/necklace, 03-questitem, 04-adena, 05-item
 		writeH(item.getCustomType1()); // Filler (always 0)
 		writeH(item.getEquipped()); // Equipped : 00-No, 01-yes
 		writeD(item.getItem().getBodyPart()); // Slot : 0006-lr.ear, 0008-neck, 0030-lr.finger, 0040-head, 0100-l.hand, 0200-gloves, 0400-chest, 0800-pants, 1000-feet, 4000-r.hand, 8000-r.hand

+ 2 - 2
src/main/java/com/l2jserver/gameserver/network/serverpackets/BuyList.java

@@ -58,8 +58,8 @@ public final class BuyList extends L2GameServerPacket
 				writeD(product.getItemId());
 				writeD(0);
 				writeQ(product.getCount() < 0 ? 0 : product.getCount());
-				writeH(product.getItem().getType2());
-				writeH(product.getItem().getType1()); // Custom Type 1
+				writeH(product.getItem().getType2().getId());
+				writeH(product.getItem().getType1().getId()); // Custom Type 1
 				writeH(0x00); // isEquipped
 				writeD(product.getItem().getBodyPart()); // Body Part
 				writeH(product.getItem().getDefaultEnchantLevel()); // Enchant

+ 1 - 1
src/main/java/com/l2jserver/gameserver/network/serverpackets/ExRpItemLink.java

@@ -41,7 +41,7 @@ public final class ExRpItemLink extends L2GameServerPacket
 		writeD(_item.getDisplayId());
 		writeD(_item.getLocationSlot());
 		writeQ(_item.getCount());
-		writeH(_item.getItem().getType2());
+		writeH(_item.getItem().getType2().getId());
 		writeH(_item.getCustomType1());
 		writeH(_item.isEquipped() ? 0x01 : 0x00);
 		writeD(_item.getItem().getBodyPart());

+ 2 - 2
src/main/java/com/l2jserver/gameserver/network/serverpackets/MultiSellList.java

@@ -83,7 +83,7 @@ public final class MultiSellList extends L2GameServerPacket
 				if (ing.getTemplate() != null)
 				{
 					writeD(ing.getTemplate().getBodyPart());
-					writeH(ing.getTemplate().getType2());
+					writeH(ing.getTemplate().getType2().getId());
 				}
 				else
 				{
@@ -124,7 +124,7 @@ public final class MultiSellList extends L2GameServerPacket
 			for (Ingredient ing : ent.getIngredients())
 			{
 				writeD(ing.getItemId());
-				writeH(ing.getTemplate() != null ? ing.getTemplate().getType2() : 65535);
+				writeH(ing.getTemplate() != null ? ing.getTemplate().getType2().getId() : 65535);
 				writeQ(ing.getItemCount());
 				if (ing.getItemInfo() != null)
 				{

+ 2 - 2
src/main/java/com/l2jserver/gameserver/network/serverpackets/SellList.java

@@ -72,11 +72,11 @@ public class SellList extends L2GameServerPacket
 		
 		for (L2ItemInstance item : _selllist)
 		{
-			writeH(item.getItem().getType1());
+			writeH(item.getItem().getType1().getId());
 			writeD(item.getObjectId());
 			writeD(item.getDisplayId());
 			writeQ(item.getCount());
-			writeH(item.getItem().getType2());
+			writeH(item.getItem().getType2().getId());
 			writeH(item.isEquipped() ? 0x01 : 0x00);
 			writeD(item.getItem().getBodyPart());
 			writeH(item.getEnchantLevel());

+ 2 - 2
src/main/java/com/l2jserver/gameserver/network/serverpackets/SellListProcure.java

@@ -54,11 +54,11 @@ public class SellListProcure extends L2GameServerPacket
 		
 		for (L2ItemInstance item : _sellList.keySet())
 		{
-			writeH(item.getItem().getType1());
+			writeH(item.getItem().getType1().getId());
 			writeD(item.getObjectId());
 			writeD(item.getDisplayId());
 			writeQ(_sellList.get(item)); // count
-			writeH(item.getItem().getType2());
+			writeH(item.getItem().getType2().getId());
 			writeH(0); // unknown
 			writeQ(0); // price, u shouldnt get any adena for crops, only raw materials
 		}

+ 3 - 3
src/main/java/com/l2jserver/gameserver/network/serverpackets/ShopPreviewList.java

@@ -23,7 +23,7 @@ import java.util.Collection;
 import com.l2jserver.Config;
 import com.l2jserver.gameserver.model.buylist.L2BuyList;
 import com.l2jserver.gameserver.model.buylist.Product;
-import com.l2jserver.gameserver.model.items.L2Item;
+import com.l2jserver.gameserver.model.items.type.ItemType1;
 
 public class ShopPreviewList extends L2GameServerPacket
 {
@@ -73,9 +73,9 @@ public class ShopPreviewList extends L2GameServerPacket
 			if ((product.getItem().getCrystalType().getId() <= _expertise) && product.getItem().isEquipable())
 			{
 				writeD(product.getItemId());
-				writeH(product.getItem().getType2()); // item type2
+				writeH(product.getItem().getType2().getId()); // item type2
 				
-				if (product.getItem().getType1() != L2Item.TYPE1_ITEM_QUESTITEM_ADENA)
+				if (product.getItem().getType1() != ItemType1.ITEM_QUESTITEM_ADENA)
 				{
 					writeH(product.getItem().getBodyPart()); // rev 415 slot 0006-lr.ear 0008-neck 0030-lr.finger 0040-head 0080-?? 0100-l.hand 0200-gloves 0400-chest 0800-pants 1000-feet 2000-?? 4000-r.hand 8000-r.hand
 				}

+ 64 - 37
src/main/java/com/l2jserver/gameserver/network/serverpackets/SortedWareHouseWithdrawalList.java

@@ -26,11 +26,11 @@ import java.util.List;
 import com.l2jserver.gameserver.data.xml.impl.RecipeData;
 import com.l2jserver.gameserver.model.L2RecipeList;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.model.items.L2Item;
 import com.l2jserver.gameserver.model.items.L2WarehouseItem;
 import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
 import com.l2jserver.gameserver.model.items.type.CrystalType;
 import com.l2jserver.gameserver.model.items.type.EtcItemType;
+import com.l2jserver.gameserver.model.items.type.ItemType2;
 import com.l2jserver.gameserver.model.items.type.MaterialType;
 
 public class SortedWareHouseWithdrawalList extends L2GameServerPacket
@@ -244,11 +244,11 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 		@Override
 		public int compare(L2WarehouseItem o1, L2WarehouseItem o2)
 		{
-			if ((o1.getType2() == L2Item.TYPE2_MONEY) && (o2.getType2() != L2Item.TYPE2_MONEY))
+			if ((o1.getType2() == ItemType2.MONEY) && (o2.getType2() != ItemType2.MONEY))
 			{
 				return (order == A2Z ? Z2A : A2Z);
 			}
-			if ((o2.getType2() == L2Item.TYPE2_MONEY) && (o1.getType2() != L2Item.TYPE2_MONEY))
+			if ((o2.getType2() == ItemType2.MONEY) && (o1.getType2() != ItemType2.MONEY))
 			{
 				return (order == A2Z ? A2Z : Z2A);
 			}
@@ -276,11 +276,11 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 		@Override
 		public int compare(L2WarehouseItem o1, L2WarehouseItem o2)
 		{
-			if ((o1.getType2() == L2Item.TYPE2_MONEY) && (o2.getType2() != L2Item.TYPE2_MONEY))
+			if ((o1.getType2() == ItemType2.MONEY) && (o2.getType2() != ItemType2.MONEY))
 			{
 				return (order == A2Z ? Z2A : A2Z);
 			}
-			if ((o2.getType2() == L2Item.TYPE2_MONEY) && (o1.getType2() != L2Item.TYPE2_MONEY))
+			if ((o2.getType2() == ItemType2.MONEY) && (o1.getType2() != ItemType2.MONEY))
 			{
 				return (order == A2Z ? A2Z : Z2A);
 			}
@@ -332,11 +332,11 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 		@Override
 		public int compare(L2WarehouseItem o1, L2WarehouseItem o2)
 		{
-			if ((o1.getType2() == L2Item.TYPE2_MONEY) && (o2.getType2() != L2Item.TYPE2_MONEY))
+			if ((o1.getType2() == ItemType2.MONEY) && (o2.getType2() != ItemType2.MONEY))
 			{
 				return (order == A2Z ? Z2A : A2Z);
 			}
-			if ((o2.getType2() == L2Item.TYPE2_MONEY) && (o1.getType2() != L2Item.TYPE2_MONEY))
+			if ((o2.getType2() == ItemType2.MONEY) && (o1.getType2() != ItemType2.MONEY))
 			{
 				return (order == A2Z ? A2Z : Z2A);
 			}
@@ -361,11 +361,11 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 		@Override
 		public int compare(L2WarehouseItem o1, L2WarehouseItem o2)
 		{
-			if ((o1.getType2() == L2Item.TYPE2_MONEY) && (o2.getType2() != L2Item.TYPE2_MONEY))
+			if ((o1.getType2() == ItemType2.MONEY) && (o2.getType2() != ItemType2.MONEY))
 			{
 				return (order == A2Z ? Z2A : A2Z);
 			}
-			if ((o2.getType2() == L2Item.TYPE2_MONEY) && (o1.getType2() != L2Item.TYPE2_MONEY))
+			if ((o2.getType2() == ItemType2.MONEY) && (o1.getType2() != ItemType2.MONEY))
 			{
 				return (order == A2Z ? A2Z : Z2A);
 			}
@@ -390,11 +390,11 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 		@Override
 		public int compare(L2WarehouseItem o1, L2WarehouseItem o2)
 		{
-			if ((o1.getType2() == L2Item.TYPE2_MONEY) && (o2.getType2() != L2Item.TYPE2_MONEY))
+			if ((o1.getType2() == ItemType2.MONEY) && (o2.getType2() != ItemType2.MONEY))
 			{
 				return (order == A2Z ? Z2A : A2Z);
 			}
-			if ((o2.getType2() == L2Item.TYPE2_MONEY) && (o1.getType2() != L2Item.TYPE2_MONEY))
+			if ((o2.getType2() == ItemType2.MONEY) && (o1.getType2() != ItemType2.MONEY))
 			{
 				return (order == A2Z ? A2Z : Z2A);
 			}
@@ -412,7 +412,10 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 	}
 	
 	/**
-	 * This method is used to limit the given Warehouse List to: <li>Weapon</li> <li>Arrow</li> <li>Money</li>
+	 * This method is used to limit the given Warehouse List to:
+	 * <li>Weapon</li>
+	 * <li>Arrow</li>
+	 * <li>Money</li>
 	 * @param _items complete Warehouse List
 	 * @return limited Item List
 	 */
@@ -421,7 +424,7 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 		List<L2WarehouseItem> list = new ArrayList<>();
 		for (L2ItemInstance item : _items)
 		{
-			if (item.isWeapon() || (item.getItem().getType2() == L2Item.TYPE2_WEAPON) || (item.isEtcItem() && (item.getItemType() == EtcItemType.ARROW)) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
+			if (item.isWeapon() || (item.getItem().getType2() == ItemType2.WEAPON) || (item.isEtcItem() && (item.getItemType() == EtcItemType.ARROW)) || (item.getItem().getType2() == ItemType2.MONEY))
 			{
 				if (list.size() < MAX_SORT_LIST_ITEMS)
 				{
@@ -437,7 +440,9 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 	}
 	
 	/**
-	 * This method is used to limit the given Warehouse List to: <li>Armor</li> <li>Money</li>
+	 * This method is used to limit the given Warehouse List to:
+	 * <li>Armor</li>
+	 * <li>Money</li>
 	 * @param _items complete Warehouse List
 	 * @return limited Item List
 	 */
@@ -446,7 +451,7 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 		List<L2WarehouseItem> list = new ArrayList<>();
 		for (L2ItemInstance item : _items)
 		{
-			if (item.isArmor() || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
+			if (item.isArmor() || (item.getItem().getType2() == ItemType2.MONEY))
 			{
 				if (list.size() < MAX_SORT_LIST_ITEMS)
 				{
@@ -462,7 +467,9 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 	}
 	
 	/**
-	 * This method is used to limit the given Warehouse List to: <li>Everything which is no Weapon/Armor</li> <li>Money</li>
+	 * This method is used to limit the given Warehouse List to:
+	 * <li>Everything which is no Weapon/Armor</li>
+	 * <li>Money</li>
 	 * @param _items complete Warehouse List
 	 * @return limited Item List
 	 */
@@ -471,7 +478,7 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 		List<L2WarehouseItem> list = new ArrayList<>();
 		for (L2ItemInstance item : _items)
 		{
-			if (item.isEtcItem() || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
+			if (item.isEtcItem() || (item.getItem().getType2() == ItemType2.MONEY))
 			{
 				if (list.size() < MAX_SORT_LIST_ITEMS)
 				{
@@ -487,7 +494,9 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 	}
 	
 	/**
-	 * This method is used to limit the given Warehouse List to: <li>Materials</li> <li>Money</li>
+	 * This method is used to limit the given Warehouse List to:
+	 * <li>Materials</li>
+	 * <li>Money</li>
 	 * @param _items complete Warehouse List
 	 * @return limited Item List
 	 */
@@ -496,7 +505,7 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 		List<L2WarehouseItem> list = new ArrayList<>();
 		for (L2ItemInstance item : _items)
 		{
-			if ((item.isEtcItem() && (item.getEtcItem().getItemType() == EtcItemType.MATERIAL)) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
+			if ((item.isEtcItem() && (item.getEtcItem().getItemType() == EtcItemType.MATERIAL)) || (item.getItem().getType2() == ItemType2.MONEY))
 			{
 				if (list.size() < MAX_SORT_LIST_ITEMS)
 				{
@@ -512,7 +521,9 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 	}
 	
 	/**
-	 * This method is used to limit the given Warehouse List to: <li>Recipes</li> <li>Money</li>
+	 * This method is used to limit the given Warehouse List to:
+	 * <li>Recipes</li>
+	 * <li>Money</li>
 	 * @param _items complete Warehouse List
 	 * @return limited Item List
 	 */
@@ -521,7 +532,7 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 		List<L2WarehouseItem> list = new ArrayList<>();
 		for (L2ItemInstance item : _items)
 		{
-			if ((item.isEtcItem() && (item.getEtcItem().getItemType() == EtcItemType.RECIPE)) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
+			if ((item.isEtcItem() && (item.getEtcItem().getItemType() == EtcItemType.RECIPE)) || (item.getItem().getType2() == ItemType2.MONEY))
 			{
 				if (list.size() < MAX_SORT_LIST_ITEMS)
 				{
@@ -537,7 +548,9 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 	}
 	
 	/**
-	 * This method is used to limit the given Warehouse List to: <li>Amulett</li> <li>Money</li>
+	 * This method is used to limit the given Warehouse List to:
+	 * <li>Amulett</li>
+	 * <li>Money</li>
 	 * @param _items complete Warehouse List
 	 * @return limited Item List
 	 */
@@ -546,7 +559,7 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 		List<L2WarehouseItem> list = new ArrayList<>();
 		for (L2ItemInstance item : _items)
 		{
-			if ((item.isEtcItem() && (item.getItemName().toUpperCase().startsWith("AMULET"))) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
+			if ((item.isEtcItem() && (item.getItemName().toUpperCase().startsWith("AMULET"))) || (item.getItem().getType2() == ItemType2.MONEY))
 			{
 				if (list.size() < MAX_SORT_LIST_ITEMS)
 				{
@@ -562,7 +575,9 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 	}
 	
 	/**
-	 * This method is used to limit the given Warehouse List to: <li>Spellbook & Dwarven Drafts</li> <li>Money</li>
+	 * This method is used to limit the given Warehouse List to:
+	 * <li>Spellbook & Dwarven Drafts</li>
+	 * <li>Money</li>
 	 * @param _items complete Warehouse List
 	 * @return limited Item List
 	 */
@@ -571,7 +586,7 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 		List<L2WarehouseItem> list = new ArrayList<>();
 		for (L2ItemInstance item : _items)
 		{
-			if ((item.isEtcItem() && (!item.getItemName().toUpperCase().startsWith("AMULET"))) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
+			if ((item.isEtcItem() && (!item.getItemName().toUpperCase().startsWith("AMULET"))) || (item.getItem().getType2() == ItemType2.MONEY))
 			{
 				if (list.size() < MAX_SORT_LIST_ITEMS)
 				{
@@ -587,7 +602,9 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 	}
 	
 	/**
-	 * This method is used to limit the given Warehouse List to: <li>Consumables (Potions, Shots, ...)</li> <li>Money</li>
+	 * This method is used to limit the given Warehouse List to:
+	 * <li>Consumables (Potions, Shots, ...)</li>
+	 * <li>Money</li>
 	 * @param _items complete Warehouse List
 	 * @return limited Item List
 	 */
@@ -596,7 +613,7 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 		List<L2WarehouseItem> list = new ArrayList<>();
 		for (L2ItemInstance item : _items)
 		{
-			if ((item.isEtcItem() && ((item.getEtcItem().getItemType() == EtcItemType.SCROLL) || (item.getEtcItem().getItemType() == EtcItemType.SHOT))) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
+			if ((item.isEtcItem() && ((item.getEtcItem().getItemType() == EtcItemType.SCROLL) || (item.getEtcItem().getItemType() == EtcItemType.SHOT))) || (item.getItem().getType2() == ItemType2.MONEY))
 			{
 				if (list.size() < MAX_SORT_LIST_ITEMS)
 				{
@@ -612,7 +629,9 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 	}
 	
 	/**
-	 * This method is used to limit the given Warehouse List to: <li>Shots</li> <li>Money</li>
+	 * This method is used to limit the given Warehouse List to:
+	 * <li>Shots</li>
+	 * <li>Money</li>
 	 * @param _items complete Warehouse List
 	 * @return limited Item List
 	 */
@@ -621,7 +640,7 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 		List<L2WarehouseItem> list = new ArrayList<>();
 		for (L2ItemInstance item : _items)
 		{
-			if ((item.isEtcItem() && (item.getEtcItem().getItemType() == EtcItemType.SHOT)) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
+			if ((item.isEtcItem() && (item.getEtcItem().getItemType() == EtcItemType.SHOT)) || (item.getItem().getType2() == ItemType2.MONEY))
 			{
 				if (list.size() < MAX_SORT_LIST_ITEMS)
 				{
@@ -637,7 +656,9 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 	}
 	
 	/**
-	 * This method is used to limit the given Warehouse List to: <li>Scrolls/Potions</li> <li>Money</li>
+	 * This method is used to limit the given Warehouse List to:
+	 * <li>Scrolls/Potions</li>
+	 * <li>Money</li>
 	 * @param _items complete Warehouse List
 	 * @return limited Item List
 	 */
@@ -646,7 +667,7 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 		List<L2WarehouseItem> list = new ArrayList<>();
 		for (L2ItemInstance item : _items)
 		{
-			if ((item.isEtcItem() && (item.getEtcItem().getItemType() == EtcItemType.SCROLL)) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
+			if ((item.isEtcItem() && (item.getEtcItem().getItemType() == EtcItemType.SCROLL)) || (item.getItem().getType2() == ItemType2.MONEY))
 			{
 				if (list.size() < MAX_SORT_LIST_ITEMS)
 				{
@@ -662,7 +683,9 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 	}
 	
 	/**
-	 * This method is used to limit the given Warehouse List to: <li>Seeds</li> <li>Money</li>
+	 * This method is used to limit the given Warehouse List to:
+	 * <li>Seeds</li>
+	 * <li>Money</li>
 	 * @param _items complete Warehouse List
 	 * @return limited Item List
 	 */
@@ -671,7 +694,7 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 		List<L2WarehouseItem> list = new ArrayList<>();
 		for (L2ItemInstance item : _items)
 		{
-			if ((item.isEtcItem() && (item.getEtcItem().getItemType() == EtcItemType.SEED)) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
+			if ((item.isEtcItem() && (item.getEtcItem().getItemType() == EtcItemType.SEED)) || (item.getItem().getType2() == ItemType2.MONEY))
 			{
 				if (list.size() < MAX_SORT_LIST_ITEMS)
 				{
@@ -687,7 +710,9 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 	}
 	
 	/**
-	 * This method is used to limit the given Warehouse List to: <li>Everything which is no Weapon/Armor, Material, Recipe, Spellbook, Scroll or Shot</li> <li>Money</li>
+	 * This method is used to limit the given Warehouse List to:
+	 * <li>Everything which is no Weapon/Armor, Material, Recipe, Spellbook, Scroll or Shot</li>
+	 * <li>Money</li>
 	 * @param _items complete Warehouse List
 	 * @return limited Item List
 	 */
@@ -696,7 +721,8 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 		List<L2WarehouseItem> list = new ArrayList<>();
 		for (L2ItemInstance item : _items)
 		{
-			if ((item.isEtcItem() && ((item.getEtcItem().getItemType() != EtcItemType.MATERIAL) && (item.getEtcItem().getItemType() != EtcItemType.RECIPE) && (item.getEtcItem().getItemType() != EtcItemType.SCROLL) && (item.getEtcItem().getItemType() != EtcItemType.SHOT))) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
+			if ((item.isEtcItem() && ((item.getEtcItem().getItemType() != EtcItemType.MATERIAL) && (item.getEtcItem().getItemType() != EtcItemType.RECIPE) && (item.getEtcItem().getItemType() != EtcItemType.SCROLL) && (item.getEtcItem().getItemType() != EtcItemType.SHOT)))
+				|| (item.getItem().getType2() == ItemType2.MONEY))
 			{
 				if (list.size() < MAX_SORT_LIST_ITEMS)
 				{
@@ -712,7 +738,8 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 	}
 	
 	/**
-	 * This method is used to limit the given Warehouse List to: <li>no limit</li> This may sound strange but we return the given Array as a List<L2WarehouseItem>
+	 * This method is used to limit the given Warehouse List to:
+	 * <li>no limit</li> This may sound strange but we return the given Array as a List<L2WarehouseItem>
 	 * @param _items complete Warehouse List
 	 * @return limited Item List
 	 */
@@ -750,7 +777,7 @@ public class SortedWareHouseWithdrawalList extends L2GameServerPacket
 			writeD(item.getItem().getDisplayId());
 			writeD(item.getLocationSlot());
 			writeQ(item.getCount());
-			writeH(item.getItem().getType2());
+			writeH(item.getItem().getType2().getId());
 			writeH(item.getCustomType1());
 			writeH(0x00); // Can't be equipped in WH
 			writeD(item.getItem().getBodyPart());

+ 1 - 1
src/main/java/com/l2jserver/gameserver/network/serverpackets/TradeOtherAdd.java

@@ -43,7 +43,7 @@ public final class TradeOtherAdd extends AbstractItemPacket
 		writeD(_item.getObjectId());
 		writeD(_item.getItem().getDisplayId());
 		writeQ(_item.getCount());
-		writeH(_item.getItem().getType2()); // item type2
+		writeH(_item.getItem().getType2().getId()); // item type2
 		writeH(_item.getCustomType1());
 		
 		writeD(_item.getItem().getBodyPart()); // rev 415 slot 0006-lr.ear 0008-neck 0030-lr.finger 0040-head 0080-?? 0100-l.hand 0200-gloves 0400-chest 0800-pants 1000-feet 2000-?? 4000-r.hand 8000-r.hand

+ 1 - 1
src/main/java/com/l2jserver/gameserver/network/serverpackets/TradeOwnAdd.java

@@ -43,7 +43,7 @@ public final class TradeOwnAdd extends AbstractItemPacket
 		writeD(_item.getObjectId());
 		writeD(_item.getItem().getDisplayId());
 		writeQ(_item.getCount());
-		writeH(_item.getItem().getType2()); // item type2
+		writeH(_item.getItem().getType2().getId()); // item type2
 		writeH(_item.getCustomType1());
 		
 		writeD(_item.getItem().getBodyPart()); // rev 415 slot 0006-lr.ear 0008-neck 0030-lr.finger 0040-head 0080-?? 0100-l.hand 0200-gloves 0400-chest 0800-pants 1000-feet 2000-?? 4000-r.hand 8000-r.hand