//Called from the Quest Object public void CheckQuests(QuestObject questObject) { currentQuestObject = questObject; QuestManager.questManager.QuestRequest(questObject); if ((questRunning || questAvaliable) && !questLogPanelActive) { ShowQuestPanel(); } else { Debug.Log("No Quests Avaliable"); } }
public bool CheckCompleteQuests(QuestObject NPCQuestObject) { for (int i = 0; i < questList.Count; i++) { for (int j = 0; j < NPCQuestObject.recievableQuestIDs.Count; j++) { if (questList[i].id == NPCQuestObject.recievableQuestIDs[j] && questList[i].progress == Quest.QuestProgress.COMPLETE) { return(true); } } } return(false); }
//BOOLS 2 public bool CheckAvaliableQuests(QuestObject NPCQuestObject) { for (int i = 0; i < questList.Count; i++) { for (int j = 0; j < NPCQuestObject.avaliableQuestIDs.Count; j++) { if (questList[i].id == NPCQuestObject.avaliableQuestIDs[j] && questList[i].progress == Quest.QuestProgress.AVALIABLE) { return(true); } } } return(false); }
//REMOVE ITEMS - User inventory system public void QuestRequest(QuestObject NPCQuestObject) { //Checking for avaliable quests if (NPCQuestObject.avaliableQuestIDs.Count > 0) { for (int i = 0; i < questList.Count; i++) { for (int j = 0; j < NPCQuestObject.avaliableQuestIDs.Count; j++) { if (questList[i].id == NPCQuestObject.avaliableQuestIDs[j] && questList[i].progress == Quest.QuestProgress.AVALIABLE) { QuestUIManager.questUIManager.questAvaliable = true; QuestUIManager.questUIManager.avaliableQuests.Add(questList[i]); } } } } //Chech for active quests for (int i = 0; i < currentQuestList.Count; i++) { for (int j = 0; j < NPCQuestObject.recievableQuestIDs.Count; j++) { if (currentQuestList[i].id == NPCQuestObject.recievableQuestIDs[j] && currentQuestList[i].progress == Quest.QuestProgress.ACCEPTED || currentQuestList[i].progress == Quest.QuestProgress.COMPLETE) { Debug.Log("Quest ID: " + NPCQuestObject.recievableQuestIDs[j] + " is " + currentQuestList[i].progress); //CompleteQuest(NPCQuestObject.recievableQuestIDs[j]); //Quest UI Manager QuestUIManager.questUIManager.questRunning = true; QuestUIManager.questUIManager.runningQuests.Add(questList[i]); } } } }