mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-23 18:54:37 +01:00
Implement Simulated Universe
This commit is contained in:
@@ -54,7 +54,7 @@ public class GameConstants {
|
||||
public static final int CHALLENGE_STORY_ENTRANCE = 102020107;
|
||||
|
||||
// Rogue
|
||||
public static final boolean ENABLE_ROGUE = false;
|
||||
public static final boolean ENABLE_ROGUE = true;
|
||||
public static final int ROGUE_ENTRANCE = 801120102;
|
||||
public static final int ROGUE_TALENT_POINT_ITEM_ID = 32;
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ public class GameData {
|
||||
@Getter private static Int2ObjectMap<RogueRoomExcel> rogueRoomExcelMap = new Int2ObjectOpenHashMap<>();
|
||||
@Getter private static Int2ObjectMap<RogueMapExcel> rogueMapExcelMap = new Int2ObjectOpenHashMap<>();
|
||||
@Getter private static Int2ObjectMap<RogueMonsterExcel> rogueMonsterExcelMap = new Int2ObjectOpenHashMap<>();
|
||||
@Getter private static Int2ObjectMap<DialogueEventExcel> rogueDialogueEventList = new Int2ObjectOpenHashMap<>();
|
||||
private static Int2ObjectMap<RogueBuffExcel> rogueBuffExcelMap = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
private static Int2ObjectMap<AvatarPromotionExcel> avatarPromotionExcelMap = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
@@ -26,6 +26,7 @@ public class GameDepot {
|
||||
@Getter private static Int2ObjectMap<RogueBuffExcel> rogueAeonBuffs = new Int2ObjectOpenHashMap<>();
|
||||
@Getter private static Int2ObjectMap<List<RogueBuffExcel>> rogueAeonEnhanceBuffs = new Int2ObjectOpenHashMap<>();
|
||||
@Getter private static List<RogueBuffExcel> rogueRandomBuffList = new ArrayList<>();
|
||||
@Getter private static List<RogueBonusExcel> rogueRandomCommonBonusList = new ArrayList<>();
|
||||
@Getter private static List<RogueMiracleExcel> rogueRandomMiracleList = new ArrayList<>();
|
||||
@Getter private static List<RogueNPCExcel> rogueRandomNpcList = new ArrayList<>();
|
||||
private static Int2ObjectMap<List<RogueMapExcel>> rogueMapDepot = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package emu.lunarcore.data.excel;
|
||||
|
||||
import emu.lunarcore.data.GameData;
|
||||
import emu.lunarcore.data.GameResource;
|
||||
import emu.lunarcore.data.ResourceType;
|
||||
import emu.lunarcore.data.ResourceType.LoadPriority;
|
||||
import emu.lunarcore.game.enums.DialogueEventCostType;
|
||||
import emu.lunarcore.game.enums.DialogueEventType;
|
||||
import emu.lunarcore.game.rogue.RogueBuffType;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@ResourceType(name = {"DialogueEvent.json"}, loadPriority = LoadPriority.LOW)
|
||||
public class DialogueEventExcel extends GameResource {
|
||||
public int EventID;
|
||||
public DialogueEventType RogueEffectType;
|
||||
public List<Integer> RogueEffectParamList;
|
||||
public DialogueEventCostType CostType;
|
||||
public List<Integer> CostParamList;
|
||||
public List<Integer> ConditionIDList;
|
||||
public RogueBuffType AeonOption;
|
||||
@Override
|
||||
public int getId() {
|
||||
return EventID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
GameData.getRogueDialogueEventList().put(EventID, this);
|
||||
}
|
||||
}
|
||||
25
src/main/java/emu/lunarcore/data/excel/RogueBonusExcel.java
Normal file
25
src/main/java/emu/lunarcore/data/excel/RogueBonusExcel.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package emu.lunarcore.data.excel;
|
||||
|
||||
import emu.lunarcore.data.GameDepot;
|
||||
import emu.lunarcore.data.GameResource;
|
||||
import emu.lunarcore.data.ResourceType;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@ResourceType(name = {"RogueBonus.json"})
|
||||
public class RogueBonusExcel extends GameResource {
|
||||
private int BonusID;
|
||||
private int BonusEvent;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return BonusID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
if (BonusID > 0 && BonusID < 10) {
|
||||
GameDepot.getRogueRandomCommonBonusList().add(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ public class RogueBuffExcel extends GameResource {
|
||||
@Override
|
||||
public void onLoad() {
|
||||
// Add to random buff list
|
||||
if (RogueBuffType >= 120 && RogueBuffType <= 126 && RogueBuffRarity >= 1 && RogueBuffRarity <= 3 && MazeBuffLevel == 1 && AeonID == 0) {
|
||||
if (RogueBuffType >= 120 && RogueBuffType <= 128 && RogueBuffRarity >= 1 && RogueBuffRarity <= 3 && MazeBuffLevel == 1 && AeonID == 0) {
|
||||
GameDepot.getRogueRandomBuffList().add(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ public class RogueMiracleExcel extends GameResource {
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
if (IsShow && MiracleReward > 0) {
|
||||
//if (IsShow && MiracleReward > 0) { // it is always false
|
||||
GameDepot.getRogueRandomMiracleList().add(this);
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public class RogueNPCExcel extends GameResource {
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
if (NPCID == 3013) {
|
||||
if (NPCID == 3013 && RogueNPCID >= 10000 && RogueNPCID <= 19999) {
|
||||
GameDepot.getRogueRandomNpcList().add(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ public class BattleService extends BaseGameService {
|
||||
for (int entityId : hitTargets) {
|
||||
if (player.getScene().getAvatarEntityIds().contains(entityId)) {
|
||||
isAmbushed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,6 +166,27 @@ public class BattleService extends BaseGameService {
|
||||
player.sendPacket(new PacketSceneCastSkillScRsp(attackedGroupId));
|
||||
}
|
||||
|
||||
public void startBattle(Player player, int stageId) {
|
||||
// Sanity check to make sure player isnt in a battle
|
||||
if (player.isInBattle()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get stage
|
||||
StageExcel stage = GameData.getStageExcelMap().get(stageId);
|
||||
if (stage == null) {
|
||||
player.sendPacket(new PacketSceneCastSkillScRsp());
|
||||
return;
|
||||
}
|
||||
|
||||
// Create new battle for player
|
||||
Battle battle = new Battle(player, player.getCurrentLineup(), stage);
|
||||
player.setBattle(battle);
|
||||
|
||||
// Send packet
|
||||
player.sendPacket(new PacketSceneCastSkillScRsp(battle, 0)); // remain to be tested
|
||||
}
|
||||
|
||||
public void startCocoon(Player player, int cocoonId, int worldLevel, int wave) {
|
||||
// Sanity check to make sure player isnt in a battle
|
||||
if (player.isInBattle()) {
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package emu.lunarcore.game.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum DialogueEventCostType {
|
||||
None(0),
|
||||
CostItemValue(1),
|
||||
CostHpCurrentPercent(2),
|
||||
CostItemPercent(3),
|
||||
CostHpSpToPercent(4),
|
||||
;
|
||||
|
||||
private int value;
|
||||
|
||||
DialogueEventCostType(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package emu.lunarcore.game.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum DialogueEventType {
|
||||
NONE(0),
|
||||
GetItem(1),
|
||||
TriggerRogueBuffSelect(2),
|
||||
TriggerRogueMiracleSelect(3),
|
||||
EnhanceRogueBuff(4),
|
||||
TriggerRandomEventList(5),
|
||||
ChangeLineupData(6),
|
||||
TriggerRogueBuffReforge(8),
|
||||
GetRogueMiracle(9),
|
||||
TriggerDialogueEventList(10),
|
||||
GetAllRogueBuffInGroup(11),
|
||||
GetAllRogueBuffInGroupAndGetItem(12),
|
||||
TriggerBattle(13),
|
||||
TriggerRogueMiracleTrade(14),
|
||||
RepeatableGamble(15),
|
||||
ReplaceRogueBuffKeepLevel(16),
|
||||
FinishChessRogue(17),
|
||||
GetRogueBuff(21),
|
||||
GetChessRogueCheatDice(18),
|
||||
SetChessRogueNextStartCellAdventureRoomType(19),
|
||||
ChangeChessRogueActionPoint(20),
|
||||
ReplaceRogueBuff(23),
|
||||
DestroyRogueMiracle(22),
|
||||
TriggerRogueBuffDrop(26),
|
||||
ChangeRogueMiracleToRogueCoin(24),
|
||||
RemoveRogueMiracle(27),
|
||||
GetItemByPercent(25),
|
||||
RemoveRogueBuff(28),
|
||||
TriggerRogueMiracleRepair(29),
|
||||
RepairRogueMiracle(30),
|
||||
ChangeRogueMiracleToRogueMiracle(31),
|
||||
ChangeRogueMiracleToRogueBuff(32),
|
||||
GetChessRogueRerollDice(33),
|
||||
GetRogueBuffByMiracleCount(34),
|
||||
ChangeNousValue(35),
|
||||
ReviveAvatar(36),
|
||||
TriggerDialogueEventListByCondition(37),
|
||||
TriggerRogueMiracleDropWithEvent(38),
|
||||
TriggerRogueBuffEnhance(39),
|
||||
GetCoinByLoseCoin(40),
|
||||
ChangeRogueNpcWeight(41),
|
||||
GetDestroyedRogueMiracle(42),
|
||||
ChangeDestroyedRogueMiracleToRogueMiracle(43),
|
||||
DestroyRogueMiracleThenGetRogueMiracle(44),
|
||||
TriggerDestroyedRogueMiracleSelect(45)
|
||||
;
|
||||
|
||||
private final int val;
|
||||
|
||||
DialogueEventType(int i) {
|
||||
this.val = i;
|
||||
}
|
||||
}
|
||||
@@ -945,8 +945,10 @@ public class Player implements Tickable {
|
||||
|
||||
public RogueVirtualItemInfo toRogueVirtualItemsProto() {
|
||||
var proto = RogueVirtualItemInfo.newInstance()
|
||||
.setRogueAbilityPoint(this.getTalentPoints());
|
||||
|
||||
.setX(this.getTalentPoints()); // remain to be discussed
|
||||
if (this.getRogueInstance() != null) {
|
||||
proto.setMoney(this.getRogueInstance().getMoney());
|
||||
}
|
||||
return proto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
14
src/main/java/emu/lunarcore/game/rogue/RogueBonusData.java
Normal file
14
src/main/java/emu/lunarcore/game/rogue/RogueBonusData.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package emu.lunarcore.game.rogue;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public class RogueBonusData {
|
||||
private int id;
|
||||
private int eventId;
|
||||
|
||||
public RogueBonusData(int id, int eventId) {
|
||||
this.id = id;
|
||||
this.eventId = eventId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package emu.lunarcore.game.rogue;
|
||||
|
||||
import emu.lunarcore.data.GameDepot;
|
||||
import emu.lunarcore.data.excel.RogueBonusExcel;
|
||||
import emu.lunarcore.proto.RogueBonusSelectInfoOuterClass.RogueBonusSelectInfo;
|
||||
import emu.lunarcore.util.WeightedList;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
public class RogueBonusSelectMenu {
|
||||
private transient RogueInstance rogue;
|
||||
|
||||
private int maxBonuses;
|
||||
private List<RogueBonusData> bonuses;
|
||||
|
||||
// Cache
|
||||
private transient WeightedList<RogueBonusExcel> randomBonuses;
|
||||
|
||||
public RogueBonusSelectMenu(RogueInstance rogue) {
|
||||
this.rogue = rogue;
|
||||
this.maxBonuses = 3;
|
||||
this.bonuses = new ArrayList<>();
|
||||
|
||||
this.generateRandomBonuses();
|
||||
}
|
||||
|
||||
public void generateRandomBonuses() {
|
||||
if (this.randomBonuses == null) {
|
||||
this.randomBonuses = new WeightedList<>();
|
||||
for (var excel : GameDepot.getRogueRandomCommonBonusList()) {
|
||||
this.randomBonuses.add(1.0, excel);
|
||||
};
|
||||
}
|
||||
|
||||
this.getBonuses().clear();
|
||||
|
||||
while (this.getBonuses().size() < this.getMaxBonuses()) {
|
||||
var excel = this.randomBonuses.next();
|
||||
this.getBonuses().add(new RogueBonusData(excel.getBonusID(), excel.getBonusEvent()));
|
||||
}
|
||||
}
|
||||
|
||||
public RogueBonusSelectInfo toProto() {
|
||||
var proto = RogueBonusSelectInfo.newInstance();
|
||||
|
||||
for (var bonus : this.getBonuses()) {
|
||||
proto.addBonusInfo(bonus.getId());
|
||||
}
|
||||
|
||||
return proto;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,9 @@ package emu.lunarcore.game.rogue;
|
||||
import emu.lunarcore.data.GameData;
|
||||
import emu.lunarcore.data.excel.RogueBuffExcel;
|
||||
import emu.lunarcore.game.battle.MazeBuff;
|
||||
import emu.lunarcore.proto.RogueBuffDataOuterClass;
|
||||
import emu.lunarcore.proto.RogueBuffOuterClass.RogueBuff;
|
||||
import emu.lunarcore.proto.RogueCommonBuffOuterClass.RogueCommonBuff;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@@ -37,4 +39,20 @@ public class RogueBuffData {
|
||||
|
||||
return proto;
|
||||
}
|
||||
|
||||
public RogueCommonBuff toCommonProto() {
|
||||
var proto = RogueCommonBuff.newInstance()
|
||||
.setBuffId(this.getId())
|
||||
.setLevel(this.getLevel());
|
||||
|
||||
return proto;
|
||||
}
|
||||
|
||||
public RogueBuffDataOuterClass.RogueBuffData toDataProto() {
|
||||
var proto = RogueBuffDataOuterClass.RogueBuffData.newInstance()
|
||||
.setBuffId(this.getId())
|
||||
.setLevel(this.getLevel());
|
||||
|
||||
return proto;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,10 @@ import java.util.List;
|
||||
|
||||
import emu.lunarcore.data.GameDepot;
|
||||
import emu.lunarcore.data.excel.RogueBuffExcel;
|
||||
import emu.lunarcore.proto.RogueBuffSelectInfoOuterClass.RogueBuffSelectInfo;
|
||||
import emu.lunarcore.proto.ItemCostListOuterClass.ItemCostList;
|
||||
import emu.lunarcore.proto.ItemCostOuterClass.ItemCost;
|
||||
import emu.lunarcore.proto.ItemCostOuterClass.PileItem;
|
||||
import emu.lunarcore.proto.RogueCommonBuffSelectInfoOuterClass.RogueCommonBuffSelectInfo;
|
||||
import emu.lunarcore.util.WeightedList;
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -81,6 +84,8 @@ public class RogueBuffSelectMenu {
|
||||
var excel = this.randomBuffs.next();
|
||||
this.getBuffs().add(new RogueBuffData(excel.getMazeBuffID(), 1));
|
||||
}
|
||||
|
||||
this.hint += 1;
|
||||
}
|
||||
|
||||
private void generateAeonBuffs() {
|
||||
@@ -114,9 +119,11 @@ public class RogueBuffSelectMenu {
|
||||
this.rogue = rogue;
|
||||
}
|
||||
|
||||
public RogueBuffSelectInfo toProto() {
|
||||
var proto = RogueBuffSelectInfo.newInstance()
|
||||
.setSelectBuffSourceHint(this.getHint());
|
||||
public RogueCommonBuffSelectInfo toProto() {
|
||||
var proto = RogueCommonBuffSelectInfo.newInstance()
|
||||
.setSelectBuffSourceHint(this.getHint())
|
||||
.setSourceCurCount(1)
|
||||
.setSourceTotalCount(1);
|
||||
|
||||
if (this.getMaxRerolls() > 0) {
|
||||
proto.setCanRoll(true);
|
||||
@@ -125,11 +132,16 @@ public class RogueBuffSelectMenu {
|
||||
}
|
||||
|
||||
for (var buff : this.getBuffs()) {
|
||||
proto.addMazeBuffList(buff.toProto());
|
||||
proto.addMazeBuffList(buff.toCommonProto());
|
||||
proto.addHandbookUnlockBuffIdList(buff.getId());
|
||||
}
|
||||
|
||||
// Create item list for reroll cost
|
||||
proto.getMutableRollBuffsCost();
|
||||
proto.setRollBuffsCost(ItemCostList.newInstance()
|
||||
.addItemList(ItemCost.newInstance()
|
||||
.setPileItem(PileItem.newInstance()
|
||||
.setItemId(31)
|
||||
.setItemNum(30))));
|
||||
|
||||
return proto;
|
||||
}
|
||||
|
||||
@@ -14,10 +14,11 @@ public enum RogueBuffType {
|
||||
Remembrance (121),
|
||||
Nihility (122),
|
||||
Abundance (123),
|
||||
Hunt (124),
|
||||
TheHunt (124),
|
||||
Destruction (125),
|
||||
Elation (126),
|
||||
Propagation (127);
|
||||
Propagation (127),
|
||||
Erudition (128);
|
||||
|
||||
private final int val;
|
||||
@Setter private int battleEventSkill;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package emu.lunarcore.game.rogue;
|
||||
|
||||
import emu.lunarcore.LunarCore;
|
||||
import emu.lunarcore.data.GameData;
|
||||
import emu.lunarcore.data.GameDepot;
|
||||
import emu.lunarcore.data.config.GroupInfo;
|
||||
@@ -17,8 +18,13 @@ import emu.lunarcore.game.scene.entity.EntityMonster;
|
||||
import emu.lunarcore.game.scene.entity.EntityNpc;
|
||||
import emu.lunarcore.game.scene.entity.EntityProp;
|
||||
import emu.lunarcore.game.scene.entity.extra.PropRogueData;
|
||||
import emu.lunarcore.proto.RogueDialogueEventParamOuterClass.RogueDialogueEventParam;
|
||||
import emu.lunarcore.server.packet.send.PacketSyncRogueDialogueEventDataScNotify;
|
||||
import emu.lunarcore.util.Utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RogueEntityLoader extends SceneEntityLoader {
|
||||
|
||||
@Override
|
||||
@@ -129,6 +135,17 @@ public class RogueEntityLoader extends SceneEntityLoader {
|
||||
if (npc.getNpcId() == 3013) {
|
||||
RogueNPCExcel rogueNpcExcel = Utils.randomElement(GameDepot.getRogueRandomNpcList());
|
||||
npc.setRogueNpcId(rogueNpcExcel.getId());
|
||||
var params = new ArrayList<RogueDialogueEventParam>();
|
||||
var start = rogueNpcExcel.getId();
|
||||
while (true) {
|
||||
var event = GameData.getRogueDialogueEventList().get(start);
|
||||
if (event == null) break;
|
||||
params.add(RogueDialogueEventParam.newInstance()
|
||||
.setDialogueEventId(start)
|
||||
.setIsValid(true));
|
||||
start++;
|
||||
}
|
||||
scene.getPlayer().sendPacket(new PacketSyncRogueDialogueEventDataScNotify(rogueNpcExcel.getId(), params));
|
||||
}
|
||||
|
||||
return npc;
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package emu.lunarcore.game.rogue;
|
||||
|
||||
import emu.lunarcore.data.GameData;
|
||||
import emu.lunarcore.game.player.Player;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public class RogueEventManager {
|
||||
private RogueInstance rogueInstance;
|
||||
private Player player;
|
||||
|
||||
public RogueEventManager(RogueInstance rogueInstance) {
|
||||
this.rogueInstance = rogueInstance;
|
||||
this.player = rogueInstance.getPlayer();
|
||||
}
|
||||
|
||||
public void handleEvent(int eventId) {
|
||||
var event = GameData.getRogueDialogueEventList().get(eventId);
|
||||
if (event == null || event.getRogueEffectType() == null) return;
|
||||
var param = event.getRogueEffectParamList();
|
||||
switch (event.getRogueEffectType()) {
|
||||
case GetItem -> rogueInstance.setMoney(rogueInstance.getMoney() + param.get(1));
|
||||
case TriggerBattle -> rogueInstance.createBuffSelect(3); //this.getPlayer().getServer().getBattleService().startBattle(player, param.get(0)); // NOT WORKING
|
||||
case TriggerRogueMiracleSelect -> this.getRogueInstance().createMiracleSelect(1);
|
||||
case TriggerRogueBuffSelect -> this.getRogueInstance().createBuffSelect(1);
|
||||
}
|
||||
handleCost(eventId);
|
||||
}
|
||||
|
||||
public void handleCost(int eventId) {
|
||||
var event = GameData.getRogueDialogueEventList().get(eventId);
|
||||
if (event == null || event.getCostType() == null) return;
|
||||
var param = event.getCostParamList();
|
||||
switch (event.getCostType()) {
|
||||
case CostItemValue -> rogueInstance.setMoney(rogueInstance.getMoney() - param.get(1));
|
||||
case CostItemPercent -> rogueInstance.setMoney(rogueInstance.getMoney() - (rogueInstance.getMoney() * param.get(1) / 100));
|
||||
case CostHpCurrentPercent -> {
|
||||
var lineup = this.getPlayer().getCurrentLineup();
|
||||
lineup.forEachAvatar(avatar -> {
|
||||
avatar.setCurrentHp(lineup, avatar.getCurrentHp(lineup) - (avatar.getCurrentHp(lineup) * param.get(0) / 100));
|
||||
});
|
||||
}
|
||||
case CostHpSpToPercent -> {
|
||||
var lineup = this.getPlayer().getCurrentLineup();
|
||||
lineup.forEachAvatar(avatar -> {
|
||||
avatar.setCurrentHp(lineup, avatar.getCurrentHp(lineup) - (avatar.getCurrentHp(lineup) * param.get(0) / 100));
|
||||
avatar.setCurrentSp(lineup, avatar.getMaxSp() - (avatar.getMaxSp() * param.get(1) / 100));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,26 +15,31 @@ import emu.lunarcore.proto.AvatarTypeOuterClass.AvatarType;
|
||||
import emu.lunarcore.proto.BattleEndStatusOuterClass.BattleEndStatus;
|
||||
import emu.lunarcore.proto.BattleStatisticsOuterClass.BattleStatistics;
|
||||
import emu.lunarcore.proto.ExtraLineupTypeOuterClass.ExtraLineupType;
|
||||
import emu.lunarcore.proto.HandleRogueCommonPendingActionScRspOuterClass.HandleRogueCommonPendingActionScRsp;
|
||||
import emu.lunarcore.proto.RogueAeonOuterClass.RogueAeon;
|
||||
import emu.lunarcore.proto.RogueAvatarInfoOuterClass.RogueAvatarInfo;
|
||||
import emu.lunarcore.proto.RogueBuffInfoOuterClass.RogueBuffInfo;
|
||||
import emu.lunarcore.proto.RogueBuffSourceOuterClass.RogueBuffSource;
|
||||
import emu.lunarcore.proto.RogueCommonPendingActionOuterClass.RogueCommonPendingAction;
|
||||
import emu.lunarcore.proto.RogueCurrentInfoOuterClass.RogueCurrentInfo;
|
||||
import emu.lunarcore.proto.RogueFinishInfoOuterClass.RogueFinishInfo;
|
||||
import emu.lunarcore.proto.RogueMapInfoOuterClass.RogueMapInfo;
|
||||
import emu.lunarcore.proto.RogueMiracleInfoOuterClass.RogueMiracleInfo;
|
||||
import emu.lunarcore.proto.RogueMiracleSourceOuterClass.RogueMiracleSource;
|
||||
import emu.lunarcore.proto.RogueRecordAvatarOuterClass.RogueRecordAvatar;
|
||||
import emu.lunarcore.proto.RogueRecordInfoOuterClass.RogueRecordInfo;
|
||||
import emu.lunarcore.proto.RogueRoomStatusOuterClass.RogueRoomStatus;
|
||||
import emu.lunarcore.proto.RogueStatusOuterClass.RogueStatus;
|
||||
import emu.lunarcore.proto.RogueVirtualItemOuterClass.RogueVirtualItem;
|
||||
import emu.lunarcore.server.packet.send.*;
|
||||
import emu.lunarcore.util.Utils;
|
||||
import lombok.Getter;
|
||||
import us.hebi.quickbuf.RepeatedInt;
|
||||
|
||||
@Getter
|
||||
public class RogueInstance {
|
||||
private transient Player player;
|
||||
private transient RogueAreaExcel excel;
|
||||
private transient RogueEventManager eventManager;
|
||||
|
||||
private int areaId;
|
||||
private int currentRoomProgress;
|
||||
@@ -50,11 +55,16 @@ public class RogueInstance {
|
||||
private RogueBuffSelectMenu buffSelect;
|
||||
private int pendingMiracleSelects;
|
||||
private RogueMiracleSelectMenu miracleSelect;
|
||||
private int pendingBonusSelects;
|
||||
private RogueBonusSelectMenu bonusSelect;
|
||||
private RogueCommonPendingAction pendingAction;
|
||||
|
||||
private int baseRerolls;
|
||||
private int aeonId;
|
||||
private int aeonBuffType;
|
||||
private int maxAeonBuffs;
|
||||
private int money; // universal debris
|
||||
private int id = 2; // idk what this is for, but it's needed for the packet
|
||||
|
||||
private int roomScore;
|
||||
private int earnedTalentCoin;
|
||||
@@ -72,6 +82,8 @@ public class RogueInstance {
|
||||
this.buffs = new HashMap<>();
|
||||
this.miracles = new HashMap<>();
|
||||
this.maxAeonBuffs = 4;
|
||||
this.money = 100;
|
||||
this.eventManager = new RogueEventManager(this);
|
||||
|
||||
if (aeonExcel != null) {
|
||||
this.aeonId = aeonExcel.getAeonID();
|
||||
@@ -160,9 +172,9 @@ public class RogueInstance {
|
||||
this.pendingBuffSelects += amount;
|
||||
|
||||
RogueBuffSelectMenu buffSelect = this.updateBuffSelect();
|
||||
if (buffSelect != null) {
|
||||
getPlayer().sendPacket(new PacketSyncRogueBuffSelectInfoScNotify(buffSelect));
|
||||
}
|
||||
// if (buffSelect != null) {
|
||||
// getPlayer().sendPacket(new PacketSyncRogueBuffSelectInfoScNotify(buffSelect));
|
||||
// }
|
||||
}
|
||||
|
||||
public synchronized RogueBuffSelectMenu updateBuffSelect() {
|
||||
@@ -179,6 +191,13 @@ public class RogueInstance {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getBuffSelect() != null) {
|
||||
var proto = new PacketSyncRogueCommonPendingActionScNotify(this.buffSelect.toProto(), this.id);
|
||||
this.id += 2;
|
||||
this.pendingAction = proto.toProto();
|
||||
this.getPlayer().sendPacket(proto);
|
||||
}
|
||||
|
||||
return this.buffSelect;
|
||||
}
|
||||
|
||||
@@ -186,9 +205,17 @@ public class RogueInstance {
|
||||
}
|
||||
|
||||
public synchronized RogueBuffSelectMenu rollBuffSelect() {
|
||||
if (getBuffSelect() != null && getBuffSelect().hasRerolls()) {
|
||||
if (getBuffSelect() != null && getBuffSelect().hasRerolls() && money >= 30) {
|
||||
this.getBuffSelect().reroll();
|
||||
this.setMoney(money - 30);
|
||||
this.getPlayer().sendPacket(new PacketHandleRogueCommonPendingActionScRsp(this.getBuffSelect().toProto(), this.id - 2));
|
||||
|
||||
var proto = new PacketSyncRogueCommonPendingActionScNotify(this.buffSelect.toProto(), this.id);
|
||||
this.id += 2;
|
||||
pendingAction = proto.toProto();
|
||||
return this.getBuffSelect();
|
||||
} else {
|
||||
this.getPlayer().sendPacket(new PacketHandleRogueCommonPendingActionScRsp(this.id - 2));
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -196,7 +223,10 @@ public class RogueInstance {
|
||||
|
||||
public synchronized RogueBuffData selectBuff(int buffId) {
|
||||
// Sanity
|
||||
if (this.getBuffSelect() == null) return null;
|
||||
if (this.getBuffSelect() == null) {
|
||||
this.getPlayer().sendPacket(new PacketHandleRogueCommonPendingActionScRsp(this.id - 2));
|
||||
return null;
|
||||
}
|
||||
|
||||
// Validate buff from buff select menu
|
||||
RogueBuffData buff = this.getBuffSelect().getBuffs()
|
||||
@@ -205,13 +235,24 @@ public class RogueInstance {
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
if (buff == null) return null;
|
||||
if (buff == null) {
|
||||
this.getPlayer().sendPacket(new PacketHandleRogueCommonPendingActionScRsp(this.id - 2));
|
||||
return null;
|
||||
}
|
||||
|
||||
// Add buff
|
||||
this.buffSelect = null;
|
||||
this.pendingAction = null;
|
||||
this.getBuffs().put(buff.getId(), buff);
|
||||
getPlayer().sendPacket(new PacketAddRogueBuffScNotify(buff, RogueBuffSource.ROGUE_BUFF_SOURCE_TYPE_SELECT));
|
||||
//getPlayer().sendPacket(new PacketAddRogueBuffScNotify(buff, RogueBuffSource.ROGUE_BUFF_SOURCE_TYPE_SELECT));
|
||||
this.updateBuffSelect();
|
||||
|
||||
this.getPlayer().sendPacket(new PacketSyncRogueCommonActionResultScNotify(RogueBuffSource.ROGUE_BUFF_SOURCE_TYPE_SELECT, buff.toDataProto()));
|
||||
|
||||
var data = HandleRogueCommonPendingActionScRsp.newInstance();
|
||||
data.getMutableRogueBuffSelect();
|
||||
data.setTimes(this.id - 2);
|
||||
this.getPlayer().sendPacket(new PacketHandleRogueCommonPendingActionScRsp(data));
|
||||
return buff;
|
||||
}
|
||||
|
||||
@@ -219,15 +260,19 @@ public class RogueInstance {
|
||||
this.pendingMiracleSelects += amount;
|
||||
|
||||
RogueMiracleSelectMenu miracleSelect = this.updateMiracleSelect();
|
||||
if (miracleSelect != null) {
|
||||
getPlayer().sendPacket(new PacketSyncRogueMiracleSelectInfoScNotify(miracleSelect));
|
||||
}
|
||||
// if (miracleSelect != null) {
|
||||
// getPlayer().sendPacket(new PacketSyncRogueMiracleSelectInfoScNotify(miracleSelect));
|
||||
// }
|
||||
}
|
||||
|
||||
public synchronized RogueMiracleSelectMenu updateMiracleSelect() {
|
||||
if (this.pendingMiracleSelects > 0 && this.getMiracleSelect() == null) {
|
||||
this.miracleSelect = new RogueMiracleSelectMenu(this);
|
||||
this.pendingMiracleSelects--;
|
||||
var proto = new PacketSyncRogueCommonPendingActionScNotify(this.miracleSelect.toProto(), this.id);
|
||||
this.id += 2;
|
||||
this.pendingAction = proto.toProto();
|
||||
this.getPlayer().sendPacket(proto);
|
||||
return this.miracleSelect;
|
||||
}
|
||||
|
||||
@@ -235,7 +280,10 @@ public class RogueInstance {
|
||||
}
|
||||
|
||||
public synchronized RogueMiracleData selectMiracle(int miracleId) {
|
||||
if (this.getMiracleSelect() == null) return null;
|
||||
if (this.getMiracleSelect() == null) {
|
||||
this.getPlayer().sendPacket(new PacketHandleRogueCommonPendingActionScRsp(this.id - 2));
|
||||
return null;
|
||||
}
|
||||
|
||||
RogueMiracleData miracle = this.getMiracleSelect().getMiracles()
|
||||
.stream()
|
||||
@@ -243,15 +291,89 @@ public class RogueInstance {
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
if (miracle == null) return null;
|
||||
if (miracle == null) {
|
||||
this.getPlayer().sendPacket(new PacketHandleRogueCommonPendingActionScRsp(this.id - 2));
|
||||
return null;
|
||||
}
|
||||
|
||||
this.miracleSelect = null;
|
||||
this.pendingAction = null;
|
||||
this.getMiracles().put(miracle.getId(), miracle);
|
||||
getPlayer().sendPacket(new PacketAddRogueMiracleScNotify(miracle, RogueMiracleSource.ROGUE_MIRACLE_SOURCE_TYPE_SELECT));
|
||||
//getPlayer().sendPacket(new PacketAddRogueMiracleScNotify(miracle, RogueMiracleSource.ROGUE_MIRACLE_SOURCE_TYPE_SELECT));
|
||||
this.updateMiracleSelect();
|
||||
this.getPlayer().sendPacket(new PacketSyncRogueCommonActionResultScNotify(RogueBuffSource.ROGUE_BUFF_SOURCE_TYPE_SELECT, miracle.toDataProto()));
|
||||
|
||||
var data = HandleRogueCommonPendingActionScRsp.newInstance();
|
||||
data.getMutableMiracleSelect();
|
||||
data.setTimes(this.id - 2);
|
||||
this.getPlayer().sendPacket(new PacketHandleRogueCommonPendingActionScRsp(data));
|
||||
return miracle;
|
||||
}
|
||||
|
||||
public synchronized void createBonusSelect(int amount) {
|
||||
this.pendingBonusSelects += amount;
|
||||
|
||||
RogueBonusSelectMenu bonusSelect = this.updateBonusSelect();
|
||||
}
|
||||
|
||||
public synchronized RogueBonusSelectMenu updateBonusSelect() {
|
||||
if (this.pendingBonusSelects > 0 && this.getBonusSelect() == null) {
|
||||
this.bonusSelect = new RogueBonusSelectMenu(this);
|
||||
this.pendingBonusSelects--;
|
||||
var proto = new PacketSyncRogueCommonPendingActionScNotify(this.bonusSelect.toProto(), this.id);
|
||||
this.id += 2;
|
||||
this.pendingAction = proto.toProto();
|
||||
this.getPlayer().sendPacket(proto);
|
||||
return this.bonusSelect;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public synchronized RogueBonusData selectBonus(int bonusId) {
|
||||
if (this.getBonusSelect() == null) {
|
||||
this.getPlayer().sendPacket(new PacketHandleRogueCommonPendingActionScRsp(this.id - 2));
|
||||
return null;
|
||||
}
|
||||
|
||||
RogueBonusData bonus = this.getBonusSelect().getBonuses()
|
||||
.stream()
|
||||
.filter(b -> b.getId() == bonusId)
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
if (bonus == null) {
|
||||
this.getPlayer().sendPacket(new PacketHandleRogueCommonPendingActionScRsp(this.id - 2));
|
||||
return null;
|
||||
}
|
||||
|
||||
this.bonusSelect = null;
|
||||
this.pendingAction = null;
|
||||
// every bonus is an event
|
||||
// TODO: add event
|
||||
var data = HandleRogueCommonPendingActionScRsp.newInstance();
|
||||
data.getMutableBonusSelect();
|
||||
data.setTimes(this.id - 2);
|
||||
this.getPlayer().sendPacket(new PacketHandleRogueCommonPendingActionScRsp(data));
|
||||
this.onSelectDialogue(bonus.getEventId());
|
||||
return bonus;
|
||||
}
|
||||
|
||||
public synchronized void setMoney(int money) {
|
||||
this.money = money;
|
||||
getPlayer().sendPacket(new PacketSyncRogueVirtualItemInfoScNotify(this.getPlayer()));
|
||||
}
|
||||
|
||||
public synchronized void pickAvatar(RepeatedInt avatarId) {
|
||||
var newAvatarIds = new HashSet<Integer>();
|
||||
for (int id : avatarId) {
|
||||
this.baseAvatarIds.add(id);
|
||||
newAvatarIds.add(id);
|
||||
}
|
||||
this.getPlayer().getLineupManager().getExtraLineupByType(ExtraLineupType.LINEUP_ROGUE_VALUE).getAvatars().addAll(newAvatarIds); // TODO: check if this is correct
|
||||
this.getPlayer().sendPacket(new PacketPickRogueAvatarScRsp(newAvatarIds));
|
||||
}
|
||||
|
||||
public synchronized RogueRoomData enterRoom(int siteId) {
|
||||
// Set status on previous room
|
||||
RogueRoomData prevRoom = this.getCurrentRoom();
|
||||
@@ -311,7 +433,7 @@ public class RogueInstance {
|
||||
// Dialogue stuff
|
||||
|
||||
public void onSelectDialogue(int dialogueEventId) {
|
||||
|
||||
this.eventManager.handleEvent(dialogueEventId);
|
||||
}
|
||||
|
||||
// Battle
|
||||
@@ -372,8 +494,13 @@ public class RogueInstance {
|
||||
.setRogueAvatarInfo(this.toAvatarInfoProto())
|
||||
.setRoomMap(this.toMapInfoProto())
|
||||
.setRogueBuffInfo(this.toBuffInfoProto())
|
||||
.setRogueMiracleInfo(this.toMiracleInfoProto());
|
||||
.setRogueMiracleInfo(this.toMiracleInfoProto())
|
||||
.setRogueAeon(this.toAeonProto())
|
||||
.setRogueVirtualItem(this.toVirtualItemProto());
|
||||
|
||||
if (pendingAction != null) {
|
||||
proto.setPendingAction(pendingAction);
|
||||
}
|
||||
return proto;
|
||||
}
|
||||
|
||||
@@ -406,12 +533,6 @@ public class RogueInstance {
|
||||
public RogueBuffInfo toBuffInfoProto() {
|
||||
var proto = RogueBuffInfo.newInstance();
|
||||
|
||||
if (this.getBuffSelect() != null) {
|
||||
proto.setBuffSelectInfo(this.getBuffSelect().toProto());
|
||||
} else {
|
||||
proto.getMutableBuffSelectInfo();
|
||||
}
|
||||
|
||||
for (var buff : this.getBuffs().values()) {
|
||||
proto.addMazeBuffList(buff.toProto());
|
||||
}
|
||||
@@ -422,21 +543,29 @@ public class RogueInstance {
|
||||
public RogueMiracleInfo toMiracleInfoProto() {
|
||||
var proto = RogueMiracleInfo.newInstance();
|
||||
|
||||
if (this.getMiracleSelect() != null) {
|
||||
proto.setMiracleSelectInfo(this.getMiracleSelect().toProto());
|
||||
} else {
|
||||
proto.getMutableMiracleSelectInfo();
|
||||
}
|
||||
|
||||
// Set flag for this so it gets serialized
|
||||
proto.getMutableRogueMiracleInfo();
|
||||
|
||||
for (var miracle : this.getMiracles().values()) {
|
||||
proto.getMutableRogueMiracleInfo().addRogueMiracleList(miracle.toProto());
|
||||
proto.getMutableRogueMiracleInfo().addRogueMiracleList(miracle.toInfoProto());
|
||||
}
|
||||
|
||||
return proto;
|
||||
}
|
||||
|
||||
public RogueAeon toAeonProto() {
|
||||
var proto = RogueAeon.newInstance()
|
||||
.setOFBCBEIEAEC(this.getAeonId());
|
||||
|
||||
return proto;
|
||||
}
|
||||
|
||||
public RogueVirtualItem toVirtualItemProto() {
|
||||
var proto = RogueVirtualItem.newInstance()
|
||||
.setMoney(this.getMoney());
|
||||
|
||||
return proto;
|
||||
}
|
||||
|
||||
public RogueFinishInfo toFinishInfoProto() {
|
||||
// Rogue record info
|
||||
@@ -465,7 +594,7 @@ public class RogueInstance {
|
||||
// Create rogue finish info
|
||||
var proto = RogueFinishInfo.newInstance()
|
||||
.setTotalScore(this.getRoomScore())
|
||||
.setTalentCoin(this.getEarnedTalentCoin())
|
||||
//.setTalentCoin(this.getEarnedTalentCoin())
|
||||
.setAreaId(this.getAreaId())
|
||||
.setIsWin(this.isWin())
|
||||
.setPassRoomCount(this.getCurrentSiteId())
|
||||
@@ -475,4 +604,4 @@ public class RogueInstance {
|
||||
return proto;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import emu.lunarcore.game.player.Player;
|
||||
import emu.lunarcore.game.player.lineup.PlayerLineup;
|
||||
import emu.lunarcore.proto.ExtraLineupTypeOuterClass.ExtraLineupType;
|
||||
import emu.lunarcore.proto.RogueAeonInfoOuterClass.RogueAeonInfo;
|
||||
import emu.lunarcore.proto.RogueAreaInfoOuterClass.RogueAreaInfo;
|
||||
import emu.lunarcore.proto.RogueAreaOuterClass.RogueArea;
|
||||
import emu.lunarcore.proto.RogueAreaStatusOuterClass.RogueAreaStatus;
|
||||
import emu.lunarcore.proto.RogueInfoDataOuterClass.RogueInfoData;
|
||||
@@ -98,6 +99,7 @@ public class RogueManager extends BasePlayerManager {
|
||||
// Get entrance id
|
||||
RogueInstance instance = new RogueInstance(getPlayer(), rogueAreaExcel, aeonExcel);
|
||||
getPlayer().setRogueInstance(instance);
|
||||
instance.createBonusSelect(1);
|
||||
|
||||
// Set starting SP
|
||||
boolean extraSP = this.hasTalent(32);
|
||||
@@ -175,55 +177,53 @@ public class RogueManager extends BasePlayerManager {
|
||||
|
||||
var score = RogueScoreRewardInfo.newInstance()
|
||||
.setPoolId(20 + getPlayer().getWorldLevel()) // TODO pool ids should not change when world level changes
|
||||
.setPoolRefreshed(true)
|
||||
.setHasTakenInitialScore(true);
|
||||
//.setPoolRefreshed(true)
|
||||
.setHasTakenInitialScore(true)
|
||||
.setBeginTime(beginTime)
|
||||
.setEndTime(endTime);
|
||||
|
||||
var season = RogueSeasonInfo.newInstance()
|
||||
.setBeginTime(beginTime)
|
||||
.setSeasonId(seasonId)
|
||||
.setEndTime(endTime);
|
||||
|
||||
var data = RogueInfoData.newInstance()
|
||||
.setRogueScoreInfo(score)
|
||||
.setRogueSeasonInfo(season);
|
||||
|
||||
var proto = RogueInfo.newInstance()
|
||||
.setRogueScoreInfo(score)
|
||||
.setRogueData(data)
|
||||
.setRogueVirtualItemInfo(getPlayer().toRogueVirtualItemsProto())
|
||||
.setSeasonId(seasonId)
|
||||
.setBeginTime(beginTime)
|
||||
.setEndTime(endTime);
|
||||
|
||||
// Path resonance
|
||||
var aeonInfo = RogueAeonInfo.newInstance();
|
||||
|
||||
if (this.hasTalent(1)) {
|
||||
aeonInfo.setIsUnlocked(false);
|
||||
|
||||
if (this.hasTalent(1) || true) { // Consider using a constant for this because talent is not working now
|
||||
aeonInfo = RogueAeonInfo.newInstance()
|
||||
.setUnlockAeonNum(GameData.getRogueAeonExcelMap().size());
|
||||
|
||||
for (var aeonExcel : GameData.getRogueAeonExcelMap().values()) {
|
||||
aeonInfo.addAeonIdList(aeonExcel.getAeonID());
|
||||
}
|
||||
|
||||
proto.setRogueAeonInfo(aeonInfo);
|
||||
aeonInfo.setIsUnlocked(true);
|
||||
aeonInfo.setJPEBPGIEGPO(3); // guess
|
||||
}
|
||||
|
||||
var data = RogueInfoData.newInstance()
|
||||
.setRogueScoreInfo(score)
|
||||
.setRogueAeonInfo(aeonInfo)
|
||||
.setRogueSeasonInfo(season);
|
||||
|
||||
// Rogue data
|
||||
RogueInstance instance = this.getPlayer().getRogueInstance();
|
||||
if (instance != null) {
|
||||
proto.setStatus(instance.getStatus());
|
||||
proto.setRogueProgress(this.getPlayer().getRogueInstance().toProto());
|
||||
proto.setRoomMap(proto.getRogueProgress().getRoomMap());
|
||||
|
||||
for (int id : instance.getBaseAvatarIds()) {
|
||||
proto.addBaseAvatarIdList(id);
|
||||
}
|
||||
|
||||
aeonInfo.setSelectedAeonId(instance.getAeonId());
|
||||
}
|
||||
// if (instance != null) {
|
||||
// proto.setStatus(instance.getStatus());
|
||||
// proto.setRogueProgress(this.getPlayer().getRogueInstance().toProto());
|
||||
// proto.setRoomMap(proto.getRogueProgress().getRoomMap());
|
||||
//
|
||||
// for (int id : instance.getBaseAvatarIds()) {
|
||||
// proto.addBaseAvatarIdList(id);
|
||||
// }
|
||||
//
|
||||
// aeonInfo.setSelectedAeonId(instance.getAeonId());
|
||||
// }
|
||||
|
||||
// Add areas
|
||||
var areaInfo = RogueAreaInfo.newInstance();
|
||||
if (schedule != null) {
|
||||
for (int i = 0; i < schedule.getRogueAreaIDList().length; i++) {
|
||||
var excel = GameData.getRogueAreaExcelMap().get(schedule.getRogueAreaIDList()[i]);
|
||||
@@ -231,17 +231,26 @@ public class RogueManager extends BasePlayerManager {
|
||||
|
||||
var area = RogueArea.newInstance()
|
||||
.setAreaId(excel.getRogueAreaID())
|
||||
.setRogueAreaStatus(RogueAreaStatus.ROGUE_AREA_STATUS_FIRST_PASS);
|
||||
.setRogueAreaStatus(RogueAreaStatus.ROGUE_AREA_STATUS_FIRST_PASS.getNumber());
|
||||
|
||||
if (instance != null && excel == instance.getExcel()) {
|
||||
area.setMapId(instance.getExcel().getMapId());
|
||||
area.setCurReachRoomNum(instance.getCurrentRoomProgress());
|
||||
area.setRogueStatus(instance.getStatus());
|
||||
//area.setRogueStatus(instance.getStatus());
|
||||
}
|
||||
|
||||
proto.addRogueAreaList(area);
|
||||
//proto.addRogueAreaList(area);
|
||||
areaInfo.addRogueArea(area);
|
||||
}
|
||||
}
|
||||
data.setRogueAreaInfo(areaInfo);
|
||||
|
||||
var proto = RogueInfo.newInstance()
|
||||
.setRogueInfoData(data);
|
||||
|
||||
if (instance != null) {
|
||||
proto.setRogueCurrentInfo(instance.toProto());
|
||||
}
|
||||
|
||||
return proto;
|
||||
}
|
||||
@@ -275,4 +284,4 @@ public class RogueManager extends BasePlayerManager {
|
||||
this.getTalents().add(talent.getTalentId());
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package emu.lunarcore.game.rogue;
|
||||
|
||||
import emu.lunarcore.proto.RogueMiracleDataInfoOuterClass.RogueMiracleDataInfo;
|
||||
import emu.lunarcore.proto.RogueMiracleDataOuterClass;
|
||||
import emu.lunarcore.proto.RogueMiracleOuterClass.RogueMiracle;
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -19,4 +21,18 @@ public class RogueMiracleData {
|
||||
|
||||
return proto;
|
||||
}
|
||||
|
||||
public RogueMiracleDataInfo toInfoProto() {
|
||||
var proto = RogueMiracleDataInfo.newInstance()
|
||||
.setMiracleId(this.getId());
|
||||
|
||||
return proto;
|
||||
}
|
||||
|
||||
public RogueMiracleDataOuterClass.RogueMiracleData toDataProto() {
|
||||
var proto = RogueMiracleDataOuterClass.RogueMiracleData.newInstance();
|
||||
proto.setRogueMiracle(this.toProto());
|
||||
|
||||
return proto;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class RogueMiracleSelectMenu {
|
||||
this.randomMiracles = new WeightedList<>();
|
||||
|
||||
for (var excel : GameDepot.getRogueRandomMiracleList()) {
|
||||
if (rogue.getBuffs().containsKey(excel.getMiracleID())) {
|
||||
if (rogue.getMiracles().containsKey(excel.getMiracleID())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class RogueMiracleSelectMenu {
|
||||
var proto = RogueMiracleSelectInfo.newInstance();
|
||||
|
||||
for (var miracle : this.getMiracles()) {
|
||||
proto.addAllMiracleIdList(miracle.getId());
|
||||
proto.addAllMiracleInfo(miracle.getId());
|
||||
}
|
||||
|
||||
return proto;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class EntityNpc implements GameEntity {
|
||||
if (this.rogueNpcId > 0) {
|
||||
var rogue = NpcRogueInfo.newInstance()
|
||||
.setRogueNpcId(this.rogueNpcId)
|
||||
.setDialogueGroupId(1);
|
||||
.setBHPGGEOBJHM(false);
|
||||
|
||||
npc.getMutableExtraInfo().setRogueInfo(rogue);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package emu.lunarcore.server.packet.recv;
|
||||
|
||||
import emu.lunarcore.server.game.GameSession;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
import emu.lunarcore.server.packet.Opcodes;
|
||||
import emu.lunarcore.server.packet.PacketHandler;
|
||||
|
||||
@Opcodes(CmdId.FinishRogueDialogueGroupCsReq)
|
||||
public class HandlerFinishRogueDialogueGroupCsReq extends PacketHandler {
|
||||
@Override
|
||||
public void handle(GameSession session, byte[] data) throws Exception {
|
||||
session.send(CmdId.FinishRogueDialogueGroupScRsp);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package emu.lunarcore.server.packet.recv;
|
||||
|
||||
import emu.lunarcore.proto.HandleRogueCommonPendingActionCsReqOuterClass.HandleRogueCommonPendingActionCsReq;
|
||||
import emu.lunarcore.server.game.GameSession;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
import emu.lunarcore.server.packet.Opcodes;
|
||||
import emu.lunarcore.server.packet.PacketHandler;
|
||||
//import emu.lunarcore.server.packet.send.PacketHandleRogueCommonPendingActionScRsp;
|
||||
|
||||
@Opcodes(CmdId.HandleRogueCommonPendingActionCsReq)
|
||||
public class HandlerHandleRogueCommonPendingActionCsReq extends PacketHandler {
|
||||
@Override
|
||||
public void handle(GameSession session, byte[] data) throws Exception {
|
||||
var proto = HandleRogueCommonPendingActionCsReq.parseFrom(data);
|
||||
|
||||
if (proto.hasBuffSelectResult()) {
|
||||
session.getPlayer().getRogueInstance().selectBuff(proto.getBuffSelectResult().getBuffId());
|
||||
} else if (proto.hasMiracleSelectResult()) {
|
||||
session.getPlayer().getRogueInstance().selectMiracle(proto.getMiracleSelectResult().getMiracleId());
|
||||
} else if (proto.hasBonusSelectResult()) {
|
||||
session.getPlayer().getRogueInstance().selectBonus(proto.getBonusSelectResult().getBonusId());
|
||||
} else if (proto.hasRollBuff()) {
|
||||
session.getPlayer().getRogueInstance().rollBuffSelect();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package emu.lunarcore.server.packet.recv;
|
||||
|
||||
import emu.lunarcore.proto.PickRogueAvatarCsReqOuterClass.PickRogueAvatarCsReq;
|
||||
import emu.lunarcore.server.game.GameSession;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
import emu.lunarcore.server.packet.Opcodes;
|
||||
import emu.lunarcore.server.packet.PacketHandler;
|
||||
|
||||
@Opcodes(CmdId.PickRogueAvatarCsReq)
|
||||
public class HandlerPickRogueAvatarCsReq extends PacketHandler {
|
||||
@Override
|
||||
public void handle(GameSession session, byte[] data) throws Exception {
|
||||
var proto = PickRogueAvatarCsReq.parseFrom(data);
|
||||
|
||||
session.getPlayer().getRogueInstance().pickAvatar(proto.getBaseAvatarList());
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package emu.lunarcore.server.packet.recv;
|
||||
|
||||
import emu.lunarcore.game.rogue.RogueBuffSelectMenu;
|
||||
import emu.lunarcore.server.game.GameSession;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
import emu.lunarcore.server.packet.Opcodes;
|
||||
import emu.lunarcore.server.packet.PacketHandler;
|
||||
import emu.lunarcore.server.packet.send.PacketRollRogueBuffScRsp;
|
||||
|
||||
@Opcodes(CmdId.NONE) // TODO update
|
||||
public class HandlerRollRogueBuffCsReq extends PacketHandler {
|
||||
|
||||
@Override
|
||||
public void handle(GameSession session, byte[] data) throws Exception {
|
||||
RogueBuffSelectMenu selectMenu = null;
|
||||
|
||||
if (session.getPlayer().getRogueInstance() != null) {
|
||||
selectMenu = session.getPlayer().getRogueInstance().rollBuffSelect();
|
||||
}
|
||||
|
||||
session.send(new PacketRollRogueBuffScRsp(selectMenu));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package emu.lunarcore.server.packet.recv;
|
||||
|
||||
import emu.lunarcore.game.rogue.RogueBuffData;
|
||||
import emu.lunarcore.game.rogue.RogueBuffSelectMenu;
|
||||
import emu.lunarcore.proto.SelectRogueBuffCsReqOuterClass.SelectRogueBuffCsReq;
|
||||
import emu.lunarcore.server.game.GameSession;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
import emu.lunarcore.server.packet.Opcodes;
|
||||
import emu.lunarcore.server.packet.PacketHandler;
|
||||
import emu.lunarcore.server.packet.send.PacketSelectRogueBuffScRsp;
|
||||
|
||||
@Opcodes(CmdId.NONE) // TODO update
|
||||
public class HandlerSelectRogueBuffCsReq extends PacketHandler {
|
||||
|
||||
@Override
|
||||
public void handle(GameSession session, byte[] data) throws Exception {
|
||||
var req = SelectRogueBuffCsReq.parseFrom(data);
|
||||
|
||||
if (session.getPlayer().getRogueInstance() != null) {
|
||||
RogueBuffData buff = session.getPlayer().getRogueInstance().selectBuff(req.getMazeBuffId());
|
||||
if (buff != null) {
|
||||
RogueBuffSelectMenu buffSelect = session.getPlayer().getRogueInstance().updateBuffSelect();
|
||||
session.send(new PacketSelectRogueBuffScRsp(buff, buffSelect));
|
||||
}
|
||||
}
|
||||
|
||||
session.send(CmdId.NONE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,7 +18,8 @@ public class HandlerSelectRogueDialogueEventCsReq extends PacketHandler {
|
||||
session.getPlayer().getRogueInstance().onSelectDialogue(req.getDialogueEventId());
|
||||
}
|
||||
|
||||
session.send(new PacketSelectRogueDialogueEventScRsp(req.getDialogueEventId()));
|
||||
session.send(new PacketSelectRogueDialogueEventScRsp(req.getDialogueEventId(), req.getEntityId(), session.getPlayer()));
|
||||
session.send(CmdId.FinishRogueDialogueGroupScRsp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
package emu.lunarcore.server.packet.recv;
|
||||
|
||||
import emu.lunarcore.game.rogue.RogueMiracleData;
|
||||
import emu.lunarcore.game.rogue.RogueMiracleSelectMenu;
|
||||
import emu.lunarcore.proto.SelectRogueMiracleCsReqOuterClass.SelectRogueMiracleCsReq;
|
||||
import emu.lunarcore.server.game.GameSession;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
import emu.lunarcore.server.packet.Opcodes;
|
||||
import emu.lunarcore.server.packet.PacketHandler;
|
||||
import emu.lunarcore.server.packet.send.PacketSelectRogueMiracleScRsp;
|
||||
|
||||
@Opcodes(CmdId.NONE) // TODO update
|
||||
public class HandlerSelectRogueMiracleCsReq extends PacketHandler {
|
||||
|
||||
@Override
|
||||
public void handle(GameSession session, byte[] data) throws Exception {
|
||||
var req = SelectRogueMiracleCsReq.parseFrom(data);
|
||||
|
||||
if (session.getPlayer().getRogueInstance() != null) {
|
||||
RogueMiracleData miracle = session.getPlayer().getRogueInstance().selectMiracle(req.getMiracleId());
|
||||
if (miracle != null) {
|
||||
RogueMiracleSelectMenu miracleSelect = session.getPlayer().getRogueInstance().updateMiracleSelect();
|
||||
session.send(new PacketSelectRogueMiracleScRsp(miracle, miracleSelect));
|
||||
}
|
||||
}
|
||||
|
||||
session.send(CmdId.NONE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package emu.lunarcore.server.packet.send;
|
||||
|
||||
import emu.lunarcore.game.rogue.RogueBuffData;
|
||||
import emu.lunarcore.proto.AddRogueBuffScNotifyOuterClass.AddRogueBuffScNotify;
|
||||
import emu.lunarcore.proto.RogueBuffSourceOuterClass.RogueBuffSource;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
|
||||
public class PacketAddRogueBuffScNotify extends BasePacket {
|
||||
|
||||
public PacketAddRogueBuffScNotify(RogueBuffData buff, RogueBuffSource source) {
|
||||
super(CmdId.NONE); // TODO update
|
||||
|
||||
var data = AddRogueBuffScNotify.newInstance()
|
||||
.setMazeBuffInfo(buff.toProto())
|
||||
.setSource(source);
|
||||
|
||||
this.setData(data);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package emu.lunarcore.server.packet.send;
|
||||
|
||||
import emu.lunarcore.game.rogue.RogueMiracleData;
|
||||
import emu.lunarcore.proto.AddRogueMiracleScNotifyOuterClass.AddRogueMiracleScNotify;
|
||||
import emu.lunarcore.proto.RogueMiracleSourceOuterClass.RogueMiracleSource;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
|
||||
public class PacketAddRogueMiracleScNotify extends BasePacket {
|
||||
|
||||
public PacketAddRogueMiracleScNotify(RogueMiracleData miracle, RogueMiracleSource rogueMiracleSource) {
|
||||
super(CmdId.NONE); // TODO update
|
||||
|
||||
var data = AddRogueMiracleScNotify.newInstance()
|
||||
.setRogueMiracle(miracle.toProto())
|
||||
.setSource(rogueMiracleSource);
|
||||
|
||||
this.setData(data);
|
||||
}
|
||||
}
|
||||
@@ -5,17 +5,24 @@ import emu.lunarcore.proto.GetRogueScoreRewardInfoScRspOuterClass.GetRogueScoreR
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class PacketGetRogueScoreRewardInfoScRsp extends BasePacket {
|
||||
|
||||
public PacketGetRogueScoreRewardInfoScRsp(Player player) {
|
||||
super(CmdId.GetRogueScoreRewardInfoScRsp);
|
||||
|
||||
var data = GetRogueScoreRewardInfoScRsp.newInstance();
|
||||
|
||||
|
||||
long beginTime = (System.currentTimeMillis() / 1000) - TimeUnit.DAYS.toSeconds(1);
|
||||
long endTime = beginTime + TimeUnit.DAYS.toSeconds(8);
|
||||
|
||||
data.getMutableScoreRewardInfo()
|
||||
.setPoolId(20 + player.getWorldLevel()) // TODO pool ids should not change when world level changes
|
||||
.setPoolRefreshed(true)
|
||||
.setHasTakenInitialScore(true);
|
||||
//.setPoolRefreshed(true)
|
||||
.setHasTakenInitialScore(true)
|
||||
.setBeginTime(beginTime)
|
||||
.setEndTime(endTime);
|
||||
|
||||
this.setData(data);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package emu.lunarcore.server.packet.send;
|
||||
|
||||
import emu.lunarcore.proto.HandleRogueCommonPendingActionScRspOuterClass.HandleRogueCommonPendingActionScRsp;
|
||||
import emu.lunarcore.proto.RogueCommonBuffSelectInfoOuterClass.RogueCommonBuffSelectInfo;
|
||||
import emu.lunarcore.proto.RogueRerollBuffOuterClass.RogueRerollBuff;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
|
||||
public class PacketHandleRogueCommonPendingActionScRsp extends BasePacket {
|
||||
public PacketHandleRogueCommonPendingActionScRsp(HandleRogueCommonPendingActionScRsp proto) {
|
||||
super(CmdId.HandleRogueCommonPendingActionScRsp);
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
|
||||
public PacketHandleRogueCommonPendingActionScRsp(int id) {
|
||||
this(HandleRogueCommonPendingActionScRsp.newInstance()
|
||||
.setTimes(id));
|
||||
}
|
||||
|
||||
public PacketHandleRogueCommonPendingActionScRsp(RogueRerollBuff rogueRerollBuff, int id) {
|
||||
this(HandleRogueCommonPendingActionScRsp.newInstance()
|
||||
.setTimes(id)
|
||||
.setRogueRerollBuff(rogueRerollBuff));
|
||||
}
|
||||
|
||||
public PacketHandleRogueCommonPendingActionScRsp(RogueCommonBuffSelectInfo buffSelectInfo, int id) {
|
||||
this(RogueRerollBuff.newInstance()
|
||||
.setBuffSelectInfo(buffSelectInfo), id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package emu.lunarcore.server.packet.send;
|
||||
|
||||
import emu.lunarcore.proto.PickRogueAvatarScRspOuterClass.PickRogueAvatarScRsp;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
public class PacketPickRogueAvatarScRsp extends BasePacket {
|
||||
public PacketPickRogueAvatarScRsp(HashSet<Integer> avatarIds) {
|
||||
super(CmdId.PickRogueAvatarScRsp);
|
||||
|
||||
var proto = PickRogueAvatarScRsp.newInstance();
|
||||
|
||||
for (var avatarId : avatarIds) {
|
||||
proto.addBaseAvatarList(avatarId);
|
||||
}
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package emu.lunarcore.server.packet.send;
|
||||
|
||||
import emu.lunarcore.game.rogue.RogueBuffSelectMenu;
|
||||
import emu.lunarcore.proto.RollRogueBuffScRspOuterClass.RollRogueBuffScRsp;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
|
||||
public class PacketRollRogueBuffScRsp extends BasePacket {
|
||||
|
||||
public PacketRollRogueBuffScRsp(RogueBuffSelectMenu selectMenu) {
|
||||
super(CmdId.NONE); // TODO update
|
||||
|
||||
var data = RollRogueBuffScRsp.newInstance();
|
||||
|
||||
if (selectMenu != null) {
|
||||
data.setBuffSelectInfo(selectMenu.toProto());
|
||||
} else {
|
||||
data.setRetcode(1);
|
||||
}
|
||||
|
||||
this.setData(data);
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package emu.lunarcore.server.packet.send;
|
||||
|
||||
import emu.lunarcore.game.rogue.RogueBuffData;
|
||||
import emu.lunarcore.game.rogue.RogueBuffSelectMenu;
|
||||
import emu.lunarcore.proto.SelectRogueBuffScRspOuterClass.SelectRogueBuffScRsp;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
|
||||
public class PacketSelectRogueBuffScRsp extends BasePacket {
|
||||
|
||||
public PacketSelectRogueBuffScRsp(RogueBuffData buff, RogueBuffSelectMenu buffSelect) {
|
||||
super(CmdId.NONE); // TODO update
|
||||
|
||||
var data = SelectRogueBuffScRsp.newInstance()
|
||||
.setMazeBuffId(buff.getId())
|
||||
.setMazeBuffLevel(buff.getLevel());
|
||||
|
||||
if (buffSelect != null) {
|
||||
data.setBuffSelectInfo(buffSelect.toProto());
|
||||
} else {
|
||||
data.getMutableBuffSelectInfo();
|
||||
}
|
||||
|
||||
this.setData(data);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,45 @@
|
||||
package emu.lunarcore.server.packet.send;
|
||||
|
||||
import emu.lunarcore.data.GameData;
|
||||
import emu.lunarcore.data.GameDepot;
|
||||
import emu.lunarcore.data.excel.RogueNPCExcel;
|
||||
import emu.lunarcore.game.player.Player;
|
||||
import emu.lunarcore.game.scene.entity.EntityNpc;
|
||||
import emu.lunarcore.proto.RogueDialogueEventOuterClass.RogueDialogueEvent;
|
||||
import emu.lunarcore.proto.RogueDialogueEventParamOuterClass.RogueDialogueEventParam;
|
||||
import emu.lunarcore.proto.SelectRogueDialogueEventScRspOuterClass.SelectRogueDialogueEventScRsp;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
import emu.lunarcore.util.Utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class PacketSelectRogueDialogueEventScRsp extends BasePacket {
|
||||
|
||||
public PacketSelectRogueDialogueEventScRsp(int dialogueEventId) {
|
||||
public PacketSelectRogueDialogueEventScRsp(int dialogueEventId, int entityId, Player player) {
|
||||
super(CmdId.SelectRogueDialogueEventScRsp);
|
||||
|
||||
var data = SelectRogueDialogueEventScRsp.newInstance()
|
||||
.setDialogueEventId(dialogueEventId);
|
||||
|
||||
RogueNPCExcel rogueNpcExcel = Utils.randomElement(GameDepot.getRogueRandomNpcList());
|
||||
var params = new ArrayList<RogueDialogueEventParam>();
|
||||
var start = rogueNpcExcel.getId();
|
||||
while (true) {
|
||||
var event = GameData.getRogueDialogueEventList().get(start);
|
||||
if (event == null) break;
|
||||
params.add(RogueDialogueEventParam.newInstance()
|
||||
.setDialogueEventId(start)
|
||||
.setIsValid(true));
|
||||
start++;
|
||||
}
|
||||
var event = RogueDialogueEvent.newInstance()
|
||||
.setNpcId(((EntityNpc)player.getScene().getEntityById(entityId)).getRogueNpcId())
|
||||
.setGameModeType(5)
|
||||
.addAllNNOHLEAOJPP(dialogueEventId)
|
||||
.addAllRogueDialogueEventParam(params.toArray(RogueDialogueEventParam[]::new));
|
||||
|
||||
data.setEventData(event);
|
||||
this.setData(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
package emu.lunarcore.server.packet.send;
|
||||
|
||||
import emu.lunarcore.game.rogue.RogueBuffSelectMenu;
|
||||
import emu.lunarcore.proto.SyncRogueBuffSelectInfoScNotifyOuterClass.SyncRogueBuffSelectInfoScNotify;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
|
||||
public class PacketSyncRogueBuffSelectInfoScNotify extends BasePacket {
|
||||
|
||||
public PacketSyncRogueBuffSelectInfoScNotify(RogueBuffSelectMenu selectMenu) {
|
||||
super(CmdId.NONE); // TODO update
|
||||
|
||||
var data = SyncRogueBuffSelectInfoScNotify.newInstance()
|
||||
.setBuffSelectInfo(selectMenu.toProto());
|
||||
|
||||
this.setData(data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package emu.lunarcore.server.packet.send;
|
||||
|
||||
import emu.lunarcore.proto.RogueBuffDataOuterClass.RogueBuffData;
|
||||
import emu.lunarcore.proto.RogueMiracleDataOuterClass.RogueMiracleData;
|
||||
import emu.lunarcore.proto.RogueActionResultDataOuterClass.RogueActionResultData;
|
||||
import emu.lunarcore.proto.RogueActionResultOuterClass.RogueActionResult;
|
||||
import emu.lunarcore.proto.RogueBuffSourceOuterClass.RogueBuffSource;
|
||||
import emu.lunarcore.proto.SyncRogueCommonActionResultScNotifyOuterClass.SyncRogueCommonActionResultScNotify;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
|
||||
public class PacketSyncRogueCommonActionResultScNotify extends BasePacket {
|
||||
public PacketSyncRogueCommonActionResultScNotify(RogueActionResult action) {
|
||||
super(CmdId.SyncRogueCommonActionResultScNotify);
|
||||
|
||||
var proto = SyncRogueCommonActionResultScNotify.newInstance();
|
||||
|
||||
proto.setAction(action);
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
|
||||
public PacketSyncRogueCommonActionResultScNotify(RogueBuffSource source, RogueActionResultData data) {
|
||||
this(RogueActionResult.newInstance()
|
||||
.setSource(source)
|
||||
.setActionData(data));
|
||||
}
|
||||
|
||||
public PacketSyncRogueCommonActionResultScNotify(RogueBuffSource source, RogueMiracleData miracle) {
|
||||
this(source, RogueActionResultData.newInstance()
|
||||
.setAddMiracleList(miracle));
|
||||
}
|
||||
|
||||
public PacketSyncRogueCommonActionResultScNotify(RogueBuffSource source, RogueBuffData buff) {
|
||||
this(source, RogueActionResultData.newInstance()
|
||||
.setAddBuffList(buff));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package emu.lunarcore.server.packet.send;
|
||||
|
||||
import emu.lunarcore.proto.RogueActionOuterClass.RogueAction;
|
||||
import emu.lunarcore.proto.RogueBonusSelectInfoOuterClass.RogueBonusSelectInfo;
|
||||
import emu.lunarcore.proto.RogueCommonBuffSelectInfoOuterClass.RogueCommonBuffSelectInfo;
|
||||
import emu.lunarcore.proto.RogueMiracleSelectInfoOuterClass.RogueMiracleSelectInfo;
|
||||
import emu.lunarcore.proto.RogueCommonPendingActionOuterClass.RogueCommonPendingAction;
|
||||
import emu.lunarcore.proto.SyncRogueCommonPendingActionScNotifyOuterClass.SyncRogueCommonPendingActionScNotify;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
|
||||
public class PacketSyncRogueCommonPendingActionScNotify extends BasePacket {
|
||||
public PacketSyncRogueCommonPendingActionScNotify(RogueCommonPendingAction action) {
|
||||
super(CmdId.SyncRogueCommonPendingActionScNotify);
|
||||
|
||||
var proto = SyncRogueCommonPendingActionScNotify.newInstance();
|
||||
|
||||
proto.setRogueCommonPendingAction(action)
|
||||
.setOCPBNBPAMEN(101); // common rogue
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
|
||||
public PacketSyncRogueCommonPendingActionScNotify(RogueAction action, int id) {
|
||||
this(RogueCommonPendingAction.newInstance()
|
||||
.setGLFDHAJPJDF(id)
|
||||
.setRogueAction(action));
|
||||
}
|
||||
|
||||
public PacketSyncRogueCommonPendingActionScNotify(RogueCommonBuffSelectInfo info, int id) {
|
||||
this(RogueAction.newInstance()
|
||||
.setBuffSelectInfo(info), id);
|
||||
}
|
||||
|
||||
public PacketSyncRogueCommonPendingActionScNotify(RogueMiracleSelectInfo info, int id) {
|
||||
this(RogueAction.newInstance()
|
||||
.setMiracleSelectInfo(info), id);
|
||||
}
|
||||
|
||||
public PacketSyncRogueCommonPendingActionScNotify(RogueBonusSelectInfo info, int id) {
|
||||
this(RogueAction.newInstance()
|
||||
.setBonusSelectInfo(info), id);
|
||||
}
|
||||
|
||||
public RogueCommonPendingAction toProto() {
|
||||
return ((SyncRogueCommonPendingActionScNotify) this.getData()).getRogueCommonPendingAction();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package emu.lunarcore.server.packet.send;
|
||||
|
||||
import emu.lunarcore.proto.RogueDialogueEventOuterClass.RogueDialogueEvent;
|
||||
import emu.lunarcore.proto.RogueDialogueEventParamOuterClass.RogueDialogueEventParam;
|
||||
import emu.lunarcore.proto.SyncRogueDialogueEventDataScNotifyOuterClass.SyncRogueDialogueEventDataScNotify;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PacketSyncRogueDialogueEventDataScNotify extends BasePacket {
|
||||
public PacketSyncRogueDialogueEventDataScNotify(RogueDialogueEvent event) {
|
||||
super(CmdId.SyncRogueDialogueEventDataScNotify);
|
||||
|
||||
var proto = SyncRogueDialogueEventDataScNotify.newInstance()
|
||||
.addRogueDialogueEvent(event);
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
|
||||
public PacketSyncRogueDialogueEventDataScNotify(int rogueNpcId, List<RogueDialogueEventParam> params) {
|
||||
this(RogueDialogueEvent.newInstance()
|
||||
.setGameModeType(5) // rogue explore
|
||||
.setNpcId(rogueNpcId)
|
||||
.addAllRogueDialogueEventParam(params.toArray(RogueDialogueEventParam[]::new)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user