mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 04:05:12 +00:00
More Party Refactoring for PartyController
- Added Quest Completion Popup to questPartyCompletion() - Added Quest Completion Message when the Party Quest is finished AND ping update - AREA KILL Quest is currently BROKEN with Parties
This commit is contained in:
1 parent
7866b4d052
commit
6936e7d86e
8 files changed
+61
-40
No files matched your search
@@ -9,9 +9,13 @@ import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.Server;
|
||||
import noppes.npcs.constants.EnumPacketClient;
|
||||
import noppes.npcs.constants.EnumQuestCompletion;
|
||||
import noppes.npcs.constants.EnumQuestType;
|
||||
import noppes.npcs.controllers.data.Party;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.data.Quest;
|
||||
import noppes.npcs.controllers.data.QuestData;
|
||||
import noppes.npcs.quests.QuestInterface;
|
||||
import noppes.npcs.quests.QuestItem;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
@@ -127,4 +131,49 @@ public class PartyController {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void sendQuestChat(Party party, String chatAlert){
|
||||
if(party == null)
|
||||
return;
|
||||
|
||||
for(String name : party.getPlayerNames()){
|
||||
EntityPlayer playerMP = NoppesUtilServer.getPlayerByName(name);
|
||||
if(playerMP != null){
|
||||
Server.sendData((EntityPlayerMP) playerMP, EnumPacketClient.CHAT, "\u00A7a", chatAlert, "!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean checkQuestCompletion(Party party, EnumQuestType type) {
|
||||
boolean bo = false;
|
||||
QuestData questData = party.getQuestData();
|
||||
if(questData == null)
|
||||
return bo;
|
||||
|
||||
if(questData.quest.type != type && type != null)
|
||||
return bo;
|
||||
|
||||
QuestInterface inter = questData.quest.questInterface;
|
||||
if(inter.isPartyCompleted(party)){
|
||||
if((!questData.isCompleted && questData.quest.completion == EnumQuestCompletion.Npc) || questData.quest.instantPartyComplete(party)){
|
||||
questData.isCompleted = true;
|
||||
if (questData.quest.completion == EnumQuestCompletion.Npc) {
|
||||
// EventHooks.onQuestFinished(player, data.quest);
|
||||
}
|
||||
bo = true;
|
||||
|
||||
party.setQuest(null);
|
||||
PartyController.Instance().pingPartyUpdate(party);
|
||||
PartyController.Instance().sendQuestChat(party, "party.completeChat");
|
||||
}
|
||||
} else {
|
||||
questData.isCompleted = false;
|
||||
}
|
||||
// if (this.trackedQuest != null && questData.quest.getId() == this.trackedQuest.getId()) {
|
||||
// NoppesUtilPlayer.sendTrackedQuestData((EntityPlayerMP) player);
|
||||
// }
|
||||
QuestItem.pickedUp = null;
|
||||
return bo;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user