Browse Source

Quest System Completed

lakebane-questing
FatBoy-DOTC 2 weeks ago
parent
commit
a3ffd53f53
  1. 8
      src/engine/QuestSystem/QuestManager.java
  2. 6
      src/engine/QuestSystem/QuestObject.java
  3. 1
      src/engine/objects/Mob.java

8
src/engine/QuestSystem/QuestManager.java

@ -53,11 +53,17 @@ public class QuestManager { @@ -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)) {

6
src/engine/QuestSystem/QuestObject.java

@ -24,8 +24,8 @@ public class QuestObject { @@ -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
src/engine/objects/Mob.java

@ -1277,6 +1277,7 @@ public class Mob extends AbstractIntelligenceAgent { @@ -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));
}

Loading…
Cancel
Save