Quest System Completed
This commit is contained in:
@@ -53,11 +53,17 @@ public class QuestManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
acceptedQuests.put(pc,obj);
|
acceptedQuests.put(pc,obj);
|
||||||
|
displayCurrentQuest(pc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void completeQuest(PlayerCharacter pc, QuestObject obj){
|
public static void completeQuest(PlayerCharacter pc, QuestObject obj){
|
||||||
|
|
||||||
|
if(obj.objectiveCount < obj.objectiveCountRequired)
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
//notify the player they have completed their quest
|
//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
|
//add completed quest to completion log
|
||||||
if (completedQuests.containsKey(pc)) {
|
if (completedQuests.containsKey(pc)) {
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ public class QuestObject {
|
|||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(this.objectiveCount >= this.objectiveCountRequired){
|
//if(this.objectiveCount >= this.objectiveCountRequired){
|
||||||
QuestManager.completeQuest(this.owner,this);
|
// //QuestManager.completeQuest(this.owner,this);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1277,6 +1277,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
PlayerCharacter pc = (PlayerCharacter)attacker;
|
PlayerCharacter pc = (PlayerCharacter)attacker;
|
||||||
if(QuestManager.acceptedQuests.containsKey(pc)){
|
if(QuestManager.acceptedQuests.containsKey(pc)){
|
||||||
QuestManager.acceptedQuests.get(pc).tryProgress(this.firstName);
|
QuestManager.acceptedQuests.get(pc).tryProgress(this.firstName);
|
||||||
|
QuestManager.completeQuest(pc,QuestManager.acceptedQuests.get(pc));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user