Quest System Completed
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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);
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user