mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-19 18:34:49 +01:00
Fixed dungeon challenge scoreboard and implement dungeon drops
Also fixed a few dungeon script handlers
This commit is contained in:
@@ -8,12 +8,14 @@ import emu.grasscutter.net.proto.DungeonChallengeBeginNotifyOuterClass.DungeonCh
|
||||
public class PacketDungeonChallengeBeginNotify extends BasePacket {
|
||||
|
||||
public PacketDungeonChallengeBeginNotify(DungeonChallenge challenge) {
|
||||
super(PacketOpcodes.DungeonChallengeBeginNotify);
|
||||
super(PacketOpcodes.DungeonChallengeBeginNotify, true);
|
||||
|
||||
DungeonChallengeBeginNotify proto = DungeonChallengeBeginNotify.newBuilder()
|
||||
.setChallengeId(challenge.getChallengeId())
|
||||
.setChallengeIndex(challenge.getChallengeIndex())
|
||||
.setGroupId(challenge.getGroup().id)
|
||||
.addParamList(challenge.getObjective())
|
||||
.addParamList(challenge.getTimeLimit())
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
|
||||
@@ -8,13 +8,12 @@ import emu.grasscutter.net.proto.DungeonChallengeFinishNotifyOuterClass.DungeonC
|
||||
public class PacketDungeonChallengeFinishNotify extends BasePacket {
|
||||
|
||||
public PacketDungeonChallengeFinishNotify(DungeonChallenge challenge) {
|
||||
super(PacketOpcodes.DungeonChallengeFinishNotify);
|
||||
super(PacketOpcodes.DungeonChallengeFinishNotify, true);
|
||||
|
||||
DungeonChallengeFinishNotify proto = DungeonChallengeFinishNotify.newBuilder()
|
||||
.setChallengeIndex(challenge.getChallengeIndex())
|
||||
.setIsSuccess(challenge.isSuccess())
|
||||
.setUnk1(challenge.getChallengeId())
|
||||
.setUnk2(30)
|
||||
.setUnk1(2)
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package emu.grasscutter.server.packet.send;
|
||||
|
||||
import emu.grasscutter.game.dungeons.DungeonChallenge;
|
||||
import emu.grasscutter.net.packet.BasePacket;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
import emu.grasscutter.net.proto.DungeonSettleNotifyOuterClass.DungeonSettleNotify;
|
||||
|
||||
public class PacketDungeonSettleNotify extends BasePacket {
|
||||
|
||||
public PacketDungeonSettleNotify(DungeonChallenge challenge) {
|
||||
super(PacketOpcodes.DungeonSettleNotify);
|
||||
|
||||
DungeonSettleNotify proto = DungeonSettleNotify.newBuilder()
|
||||
.setDungeonId(challenge.getScene().getDungeonData().getId())
|
||||
.setIsSuccess(challenge.isSuccess())
|
||||
.setCloseTime(challenge.getScene().getAutoCloseTime())
|
||||
.setResult(challenge.isSuccess() ? 1 : 0)
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package emu.grasscutter.server.packet.send;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import emu.grasscutter.game.inventory.GameItem;
|
||||
import emu.grasscutter.net.packet.BasePacket;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
import emu.grasscutter.net.proto.GadgetAutoPickDropInfoNotifyOuterClass.GadgetAutoPickDropInfoNotify;
|
||||
import emu.grasscutter.net.proto.GadgetAutoPickDropInfoNotifyOuterClass.GadgetAutoPickDropInfoNotify.Builder;
|
||||
|
||||
public class PacketGadgetAutoPickDropInfoNotify extends BasePacket {
|
||||
|
||||
public PacketGadgetAutoPickDropInfoNotify(Collection<GameItem> items) {
|
||||
super(PacketOpcodes.GadgetAutoPickDropInfoNotify);
|
||||
|
||||
GadgetAutoPickDropInfoNotify.Builder proto = GadgetAutoPickDropInfoNotify.newBuilder();
|
||||
|
||||
items.forEach(item -> proto.addItemList(item.toProto()));
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user