Browse Source

new method QuestState.hasQuestItems(int) to check player inventory for item. Thx jurchiks.

JIV 15 years ago
parent
commit
fa79d5e9f8

+ 9 - 0
L2_GameServer/java/com/l2jserver/gameserver/model/quest/QuestState.java

@@ -550,6 +550,15 @@ public final class QuestState
 		return count;
 		return count;
 	}
 	}
 
 
+	/**
+	 * @param int : ID of the item you're looking for
+	 * @return true if item exists in player's inventory, false - if not
+	 */
+	public boolean hasQuestItems(int itemId)
+	{
+		return getPlayer().getInventory().getItemByItemId(itemId) != null;
+	}
+
 	/**
 	/**
 	 * Return the level of enchantment on the weapon of the player(Done specifically for weapon SA's)
 	 * Return the level of enchantment on the weapon of the player(Done specifically for weapon SA's)
 	 * @param itemId : ID of the item to check enchantment
 	 * @param itemId : ID of the item to check enchantment