mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-23 22:59:41 +00:00
Party Quest Tracking
This commit is contained in:
1 parent
7a251ad64e
commit
67d4b3bd15
16 files changed
+308
-36
No files matched your search
@@ -348,11 +348,35 @@ public class QuestKill extends QuestInterface implements IQuestKill {
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
if(party != null) {
|
||||
if(party.getObjectiveRequirement() == EnumPartyObjectives.All ){
|
||||
return this.entity + ": " + this.getMaxProgress() + (isCompleted() ? " (Done)" : "");
|
||||
}
|
||||
}
|
||||
return this.entity + ": " + this.getProgress() + "/" + this.getMaxProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAdditionalText() {
|
||||
if(party != null) {
|
||||
List<String> incompletePlayers = new ArrayList<>();
|
||||
QuestData questdata = party.getQuestData();
|
||||
if (questdata != null) {
|
||||
if (questdata.quest.partyOptions.objectiveRequirement == EnumPartyObjectives.All) {
|
||||
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){
|
||||
String state = player + ": " + currentProgress;
|
||||
incompletePlayers.add(state);
|
||||
}
|
||||
}
|
||||
if(!incompletePlayers.isEmpty())
|
||||
return "[" + String.join(", ", incompletePlayers) + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user