Added quest tracking, need to add objectives list and turn in info too.

This commit is contained in:
Luis C.M committed 2022-05-27 14:32:24 -05:00
1 parent 2895f7a76a
commit 301e113be2
15 files changed
+751 -55

No files matched your search

+11 -2
View File
@@ -12,6 +12,7 @@ import noppes.npcs.controllers.PlayerQuestController;
import noppes.npcs.controllers.data.Quest;
public class QuestLogData {
public String trackedQuestKey = "";
public HashMap<String,Vector<String>> categories = new HashMap<String,Vector<String>>();
public String selectedQuest = "";
public String selectedCategory = "";
@@ -25,6 +26,7 @@ public class QuestLogData {
compound.setTag("Logs", NBTTags.nbtStringStringMap(questText));
compound.setTag("Status", NBTTags.nbtVectorMap(questStatus));
compound.setTag("QuestFinisher", NBTTags.nbtStringStringMap(finish));
compound.setString("TrackedQuestID", trackedQuestKey);
return compound;
}
@@ -33,11 +35,12 @@ public class QuestLogData {
questText = NBTTags.getStringStringMap(compound.getTagList("Logs", 10));
questStatus = NBTTags.getVectorMap(compound.getTagList("Status", 10));
finish = NBTTags.getStringStringMap(compound.getTagList("QuestFinisher", 10));
trackedQuestKey = compound.getString("TrackedQuestID");
}
public void setData(EntityPlayer player){
PlayerData playerData = PlayerDataController.instance.getPlayerData(player);
for(Quest quest : PlayerQuestController.getActiveQuests(player))
for(Quest quest : PlayerQuestController.getActiveQuests(player))
{
String category = quest.category.title;
if(!categories.containsKey(category))
@@ -50,6 +53,12 @@ public class QuestLogData {
questStatus.put(category + ":" + quest.title, quest.questInterface.getQuestLogStatus(player));
if(quest.completion == EnumQuestCompletion.Npc && quest.questInterface.isCompleted(playerData))
finish.put(category + ":" + quest.title, quest.completerNpc);
if (playerData.questData.trackedQuest != null) {
if (quest.id == playerData.questData.trackedQuest.getId()) {
trackedQuestKey = category + ":" + quest.title;
}
}
}
}