فهرست منبع

Added new method hasQuestCompleted

Adry85 7 سال پیش
والد
کامیت
63fa9953d1
1فایلهای تغییر یافته به همراه11 افزوده شده و 0 حذف شده
  1. 11 0
      src/main/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

+ 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