forked from Grasscutters/Grasscutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add reliquary decomposition (aka strongbox).
- Loading branch information
1 parent
9524482
commit 6338c17
Showing
7 changed files
with
170 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/emu/grasscutter/game/combine/ReliquaryDecomposeEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package emu.grasscutter.game.combine; | ||
|
||
import java.util.List; | ||
|
||
public class ReliquaryDecomposeEntry { | ||
private int configId; | ||
private List<Integer> items; | ||
|
||
public int getConfigId() { | ||
return configId; | ||
} | ||
public void setConfigId(int configId) { | ||
this.configId = configId; | ||
} | ||
|
||
public List<Integer> getItems() { | ||
return items; | ||
} | ||
public void setItems(List<Integer> items) { | ||
this.items = items; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/emu/grasscutter/server/packet/recv/HandlerReliquaryDecomposeReq.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package emu.grasscutter.server.packet.recv; | ||
|
||
import emu.grasscutter.net.packet.Opcodes; | ||
import emu.grasscutter.net.packet.PacketOpcodes; | ||
import emu.grasscutter.net.proto.ReliquaryDecomposeReqOuterClass.ReliquaryDecomposeReq; | ||
import emu.grasscutter.net.packet.PacketHandler; | ||
import emu.grasscutter.server.game.GameSession; | ||
|
||
@Opcodes(PacketOpcodes.ReliquaryDecomposeReq) | ||
public class HandlerReliquaryDecomposeReq extends PacketHandler { | ||
@Override | ||
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { | ||
ReliquaryDecomposeReq req = ReliquaryDecomposeReq.parseFrom(payload); | ||
session.getServer().getCombineManger().decomposeReliquaries(session.getPlayer(), req.getConfigId(), req.getTargetCount(), req.getGuidListList()); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/emu/grasscutter/server/packet/send/PacketReliquaryDecomposeRsp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package emu.grasscutter.server.packet.send; | ||
|
||
import java.util.List; | ||
|
||
import emu.grasscutter.net.packet.BasePacket; | ||
import emu.grasscutter.net.packet.PacketOpcodes; | ||
import emu.grasscutter.net.proto.ReliquaryDecomposeRspOuterClass.ReliquaryDecomposeRsp; | ||
import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode; | ||
|
||
public class PacketReliquaryDecomposeRsp extends BasePacket { | ||
public PacketReliquaryDecomposeRsp(Retcode retcode) { | ||
super(PacketOpcodes.ReliquaryDecomposeRsp); | ||
|
||
ReliquaryDecomposeRsp proto = ReliquaryDecomposeRsp.newBuilder() | ||
.setRetcode(retcode.getNumber()) | ||
.build(); | ||
|
||
this.setData(proto); | ||
} | ||
|
||
public PacketReliquaryDecomposeRsp(List<Long> output) { | ||
super(PacketOpcodes.ReliquaryDecomposeRsp); | ||
|
||
ReliquaryDecomposeRsp proto = ReliquaryDecomposeRsp.newBuilder() | ||
.addAllGuidList(output) | ||
.build(); | ||
|
||
this.setData(proto); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[ | ||
{ | ||
"configId": 1, | ||
"comment": "Gladiator", | ||
"items": [75513, 75514, 75523, 75524, 75533, 75534, 75543, 75544, 75553, 75554] | ||
}, | ||
{ | ||
"configId": 2, | ||
"comment": "Wanderer's Troupe", | ||
"items": [77513, 77514, 77523, 77524, 77533, 77534, 77543, 77544, 77553, 77554] | ||
}, | ||
{ | ||
"configId": 3, | ||
"comment": "Bloodstained", | ||
"items": [82513, 82514, 82523, 82524, 82533, 82534, 82543, 82544, 82553, 82554] | ||
}, | ||
{ | ||
"configId": 4, | ||
"comment": "Noblesse", | ||
"items": [81513, 81514, 81523, 81524, 81533, 81534, 81543, 81544, 81553, 81554] | ||
} | ||
] |