2
0
Эх сурвалжийг харах

Added new method hasQuestCompleted

Adry85 7 жил өмнө
parent
commit
63fa9953d1

+ 11 - 0
src/main/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -1314,6 +1314,17 @@ public final class L2PcInstance extends L2Playable
 		return _quests.containsKey(quest);
 	}
 	
+	/**
+	 * Verify if this player has completed the given quest.
+	 * @param quest to check if its completed or not.
+	 * @return {@code true} if the player has completed the given quest, {@code false} otherwise.
+	 */
+	public boolean hasQuestCompleted(String quest)
+	{
+		final QuestState qs = _quests.get(quest);
+		return (qs != null) && qs.isCompleted();
+	}
+	
 	/**
 	 * Remove a QuestState from the table _quest containing all quests began by the L2PcInstance.
 	 * @param quest The name of the quest