Commit 797afd4c authored by Melledy's avatar Melledy Committed by GitHub
Browse files

Merge pull request #1553 from akatatsu27/questing

Major quest framework improvements
parents 1c5c3633 8bdcfb89
...@@ -7,24 +7,24 @@ import emu.grasscutter.net.packet.PacketOpcodes; ...@@ -7,24 +7,24 @@ import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.QuestProgressUpdateNotifyOuterClass.QuestProgressUpdateNotify; import emu.grasscutter.net.proto.QuestProgressUpdateNotifyOuterClass.QuestProgressUpdateNotify;
public class PacketQuestProgressUpdateNotify extends BasePacket { public class PacketQuestProgressUpdateNotify extends BasePacket {
public PacketQuestProgressUpdateNotify(GameQuest quest) { public PacketQuestProgressUpdateNotify(GameQuest quest) {
super(PacketOpcodes.QuestProgressUpdateNotify); super(PacketOpcodes.QuestProgressUpdateNotify);
QuestProgressUpdateNotify.Builder proto = QuestProgressUpdateNotify.newBuilder().setQuestId(quest.getQuestId()); QuestProgressUpdateNotify.Builder proto = QuestProgressUpdateNotify.newBuilder().setQuestId(quest.getSubQuestId());
if (quest.getFinishProgressList() != null) { if (quest.getFinishProgressList() != null) {
for (int i : quest.getFinishProgressList()) { for (int i : quest.getFinishProgressList()) {
proto.addFinishProgressList(i); proto.addFinishProgressList(i);
} }
} }
if (quest.getFailProgressList() != null) { if (quest.getFailProgressList() != null) {
for (int i : quest.getFailProgressList()) { for (int i : quest.getFailProgressList()) {
proto.addFailProgressList(i); proto.addFailProgressList(i);
} }
} }
this.setData(proto); this.setData(proto);
} }
} }
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.QuestUpdateQuestVarReqOuterClass;
import emu.grasscutter.net.proto.QuestUpdateQuestVarRspOuterClass;
@Opcodes(PacketOpcodes.QuestUpdateQuestVarReq)
public class PacketQuestUpdateQuestVarRsp extends BasePacket {
public PacketQuestUpdateQuestVarRsp(int questId) {
super(PacketOpcodes.QuestUpdateQuestVarRsp);
var rsp = QuestUpdateQuestVarRspOuterClass.QuestUpdateQuestVarRsp.newBuilder()
.setQuestId(questId).build();
this.setData(rsp);
}
}
...@@ -6,8 +6,11 @@ import emu.grasscutter.net.packet.BasePacket; ...@@ -6,8 +6,11 @@ import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.ServerCondMeetQuestListUpdateNotifyOuterClass.ServerCondMeetQuestListUpdateNotify; import emu.grasscutter.net.proto.ServerCondMeetQuestListUpdateNotifyOuterClass.ServerCondMeetQuestListUpdateNotify;
import java.util.List;
import java.util.Set;
public class PacketServerCondMeetQuestListUpdateNotify extends BasePacket { public class PacketServerCondMeetQuestListUpdateNotify extends BasePacket {
public PacketServerCondMeetQuestListUpdateNotify(Player player) { public PacketServerCondMeetQuestListUpdateNotify(Player player) {
super(PacketOpcodes.ServerCondMeetQuestListUpdateNotify); super(PacketOpcodes.ServerCondMeetQuestListUpdateNotify);
...@@ -23,13 +26,24 @@ public class PacketServerCondMeetQuestListUpdateNotify extends BasePacket { ...@@ -23,13 +26,24 @@ public class PacketServerCondMeetQuestListUpdateNotify extends BasePacket {
this.setData(proto); this.setData(proto);
} }
public PacketServerCondMeetQuestListUpdateNotify(GameQuest quest) { public PacketServerCondMeetQuestListUpdateNotify(List<GameQuest> quests) {
super(PacketOpcodes.ServerCondMeetQuestListUpdateNotify); super(PacketOpcodes.ServerCondMeetQuestListUpdateNotify);
ServerCondMeetQuestListUpdateNotify proto = ServerCondMeetQuestListUpdateNotify.newBuilder() ServerCondMeetQuestListUpdateNotify.Builder proto = ServerCondMeetQuestListUpdateNotify.newBuilder();
//.addAddQuestIdList(quest.getQuestId()) for (GameQuest quest : quests) {
.build(); proto.addAddQuestIdList(quest.getSubQuestId());
}
proto.build();
this.setData(proto);
}
public PacketServerCondMeetQuestListUpdateNotify() {
super(PacketOpcodes.ServerCondMeetQuestListUpdateNotify);
ServerCondMeetQuestListUpdateNotify.Builder proto = ServerCondMeetQuestListUpdateNotify.newBuilder();
proto.build();
this.setData(proto); this.setData(proto);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment