Quest System Completed

This commit is contained in:
2025-01-18 20:53:34 -06:00
parent e6e1cab715
commit a3ffd53f53
3 changed files with 11 additions and 4 deletions
+7 -1
View File
@@ -53,11 +53,17 @@ public class QuestManager {
}
acceptedQuests.put(pc,obj);
displayCurrentQuest(pc);
}
public static void completeQuest(PlayerCharacter pc, QuestObject obj){
if(obj.objectiveCount < obj.objectiveCountRequired)
return;
//notify the player they have completed their quest
ErrorPopupMsg.sendErrorMsg(pc, "You have completed the quest: " + obj.QuestName);
ErrorPopupMsg.sendErrorMsg(pc, "You have completed the quest: " + obj.QuestName +"! " + "Experience Reward: " + (int) (Experience.maxXPPerKill(pc.getLevel()) * 10) + " Gold Reward: " + (int) Experience.maxXPPerKill(pc.getLevel()));
//add completed quest to completion log
if (completedQuests.containsKey(pc)) {
+3 -3
View File
@@ -24,8 +24,8 @@ public class QuestObject {
else
return;
if(this.objectiveCount >= this.objectiveCountRequired){
QuestManager.completeQuest(this.owner,this);
}
//if(this.objectiveCount >= this.objectiveCountRequired){
// //QuestManager.completeQuest(this.owner,this);
//}
}
}
+1
View File
@@ -1277,6 +1277,7 @@ public class Mob extends AbstractIntelligenceAgent {
PlayerCharacter pc = (PlayerCharacter)attacker;
if(QuestManager.acceptedQuests.containsKey(pc)){
QuestManager.acceptedQuests.get(pc).tryProgress(this.firstName);
QuestManager.completeQuest(pc,QuestManager.acceptedQuests.get(pc));
}