mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-22 07:22:20 +00:00
Fix (Done) Message for Quest Kill and Quest Manual for Objective ALL type in parties
This commit is contained in:
1 parent
7eef21df0d
commit
198ad10f27
2 files changed
+12
-6
No files matched your search
@@ -277,14 +277,17 @@ public class QuestKill extends QuestInterface implements IQuestKill {
|
||||
QuestData questdata = party.getQuestData();
|
||||
if (questdata != null) {
|
||||
if (questdata.quest.partyOptions.objectiveRequirement == EnumPartyObjectives.All) {
|
||||
int progress = 0;
|
||||
int howManyDone = 0;
|
||||
for (String player : party.getPlayerNames()) {
|
||||
HashMap<String, Integer> killed = this.parent.getPlayerKilled(questdata, player);
|
||||
int currentProgress = !killed.containsKey(this.entity) ? 0 : (Integer) killed.get(this.entity);
|
||||
if(currentProgress >= this.amount)
|
||||
progress += 1;
|
||||
howManyDone += 1;
|
||||
}
|
||||
return progress;
|
||||
if(howManyDone == party.getPlayerNames().size())
|
||||
return getMaxProgress();
|
||||
|
||||
return 0;
|
||||
} else {
|
||||
HashMap<String, Integer> killed = this.parent.getKilled(questdata);
|
||||
return !killed.containsKey(this.entity) ? 0 : (Integer) killed.get(this.entity);
|
||||
|
||||
@@ -229,14 +229,17 @@ public class QuestManual extends QuestInterface{
|
||||
QuestData questdata = party.getQuestData();
|
||||
if (questdata != null) {
|
||||
if (questdata.quest.partyOptions.objectiveRequirement == EnumPartyObjectives.All) {
|
||||
int progress = 0;
|
||||
int howManyDone = 0;
|
||||
for (String player : party.getPlayerNames()) {
|
||||
HashMap<String, Integer> playerManual = getPlayerManual(questdata, player);
|
||||
int currentProgress = !playerManual.containsKey(this.entity) ? 0 : (Integer) playerManual.get(this.entity);
|
||||
if(currentProgress >= this.amount)
|
||||
progress += 1;
|
||||
howManyDone += 1;
|
||||
}
|
||||
return progress;
|
||||
if(howManyDone == party.getPlayerNames().size())
|
||||
return getMaxProgress();
|
||||
|
||||
return 0;
|
||||
} else {
|
||||
HashMap<String, Integer> playerManual = getManual(questdata);
|
||||
return !playerManual.containsKey(this.entity) ? 0 : (Integer) playerManual.get(this.entity);
|
||||
|
||||
Reference in new issue
Block a user