mirror of
https://github.com/Melledy/LunarCore.git
synced 2026-03-26 08:52:30 +01:00
Update to support game version 2.1.0
This commit is contained in:
@@ -6,13 +6,13 @@ import java.time.ZoneOffset;
|
||||
import emu.lunarcore.util.Position;
|
||||
|
||||
public class GameConstants {
|
||||
public static String VERSION = "2.0.0";
|
||||
public static String VERSION = "2.1.0";
|
||||
|
||||
public static final ZoneOffset CURRENT_ZONEOFFSET = ZoneOffset.systemDefault().getRules().getOffset(Instant.now());
|
||||
public static final int CURRENT_TIMEZONE = CURRENT_ZONEOFFSET.getTotalSeconds() / 3600;
|
||||
|
||||
// Game
|
||||
public static final String DEFAULT_NAME = "Trailblazer";
|
||||
public static final String DEFAULT_NAME = "A Nameless";
|
||||
public static final int[] DEFAULT_HEAD_ICONS = {208001, 208002};
|
||||
public static final int TRAILBLAZER_AVATAR_ID = 8001;
|
||||
public static final int MAX_TRAILBLAZER_LEVEL = 70;
|
||||
@@ -35,7 +35,7 @@ public class GameConstants {
|
||||
public static final int RELIC_REMAINS_ID = 235;
|
||||
|
||||
public static final int INVENTORY_MAX_EQUIPMENT = 1500;
|
||||
public static final int INVENTORY_MAX_RELIC = 1500;
|
||||
public static final int INVENTORY_MAX_RELIC = 2000;
|
||||
public static final int INVENTORY_MAX_MATERIAL = 2000;
|
||||
|
||||
// Start position
|
||||
@@ -55,7 +55,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;
|
||||
|
||||
|
||||
@@ -23,17 +23,17 @@ public class SkillAbilityInfo {
|
||||
List<MazeSkillAction> actionList = null;
|
||||
|
||||
// Skip if not a maze skill
|
||||
if (ability.getName().contains("MazeSkill")) {
|
||||
if (ability.getName().endsWith("MazeSkill")) {
|
||||
skill = new MazeSkill(avatarExcel, 2);
|
||||
avatarExcel.setMazeSkill(skill);
|
||||
|
||||
actionList = skill.getCastActions();
|
||||
|
||||
// Hacky way to check if an avatar can summon with their skill
|
||||
var summonUnitExcel = GameData.getSummonUnitExcelMap().get((skill.getId() * 10) + 1);
|
||||
if (summonUnitExcel != null && !summonUnitExcel.isIsClient()) {
|
||||
var excel = GameData.getSummonUnitExcelMap().get((skill.getId() * 10) + 1);
|
||||
if (excel != null && !excel.isIsClient() && excel.getInfo() != null) {
|
||||
// TODO duration is hardcoded
|
||||
skill.getCastActions().add(new MazeSkillSummonUnit(summonUnitExcel, 20));
|
||||
skill.getCastActions().add(new MazeSkillSummonUnit(excel, 20));
|
||||
}
|
||||
} else if (ability.getName().contains("NormalAtk")) {
|
||||
skill = new MazeSkill(avatarExcel, 1);
|
||||
@@ -69,18 +69,25 @@ public class SkillAbilityInfo {
|
||||
actionList.add(new MazeSkillModifySP(50));
|
||||
} else if (task.getType().contains("CreateSummonUnit")) {
|
||||
skill.setTriggerBattle(false);
|
||||
} else if (task.getType().contains("AdventureSetAttackTargetMonsterDie")) {
|
||||
actionList.add(new MazeSkillSetAttackTargetMonsterDie());
|
||||
} else if (task.getSuccessTaskList() != null) {
|
||||
for (TaskInfo t : task.getSuccessTaskList()) {
|
||||
parseTask(skill, actionList, t);
|
||||
}
|
||||
} else if (task.getType().contains("AdventureTriggerAttack")) {
|
||||
if (skill.getIndex() == 2) {
|
||||
skill.setTriggerBattle(task.isTriggerBattle());
|
||||
}
|
||||
if (task.getOnAttack() != null) {
|
||||
for (TaskInfo t : task.getOnAttack()) {
|
||||
parseTask(skill, skill.getAttackActions(), t);
|
||||
}
|
||||
}
|
||||
if (skill.getIndex() == 2) {
|
||||
skill.setTriggerBattle(task.isTriggerBattle());
|
||||
if (task.getOnBattle() != null) {
|
||||
for (TaskInfo t : task.getOnBattle()) {
|
||||
parseTask(skill, skill.getAttackActions(), t);
|
||||
}
|
||||
}
|
||||
} else if (task.getType().contains("AdventureFireProjectile")) {
|
||||
if (task.getOnProjectileHit() != null) {
|
||||
|
||||
@@ -21,8 +21,8 @@ public class TaskInfo {
|
||||
private boolean TriggerBattle = true;
|
||||
private DynamicFloat LifeTime;
|
||||
|
||||
@SerializedName(value = "OnAttack", alternate = {"OnBattle"})
|
||||
private List<TaskInfo> OnAttack;
|
||||
private List<TaskInfo> OnBattle;
|
||||
private List<TaskInfo> SuccessTaskList;
|
||||
private List<TaskInfo> OnProjectileHit;
|
||||
private List<TaskInfo> OnProjectileLifetimeFinish;
|
||||
|
||||
@@ -2,6 +2,7 @@ package emu.lunarcore.data.excel;
|
||||
|
||||
import emu.lunarcore.data.GameResource;
|
||||
import emu.lunarcore.data.ResourceType;
|
||||
import emu.lunarcore.game.enums.MonsterRank;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@@ -9,6 +10,7 @@ import lombok.Getter;
|
||||
public class NpcMonsterExcel extends GameResource {
|
||||
private int ID;
|
||||
private long NPCName;
|
||||
private MonsterRank Rank;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
|
||||
@@ -16,10 +16,10 @@ import com.google.gson.annotations.SerializedName;
|
||||
@Getter
|
||||
@ResourceType(name = {"RogueBuffGroup.json"}, loadPriority = LoadPriority.LOW)
|
||||
public class RogueBuffGroupExcel extends GameResource {
|
||||
@SerializedName(value = "GJHLAKLLFDI")
|
||||
@SerializedName(value = "EGDAIIJDDPA")
|
||||
private int RogueBuffGroupID; // RogueBuffGroupID
|
||||
|
||||
@SerializedName(value = "DNKFBOAIDCE")
|
||||
@SerializedName(value = "AMGHNOBDGLM")
|
||||
private IntArrayList RogueBuffTagList; // RogueBuffTagList or RogueBuffGroupList
|
||||
|
||||
private transient Set<RogueBuffData> rogueBuffList = new HashSet<>();
|
||||
|
||||
@@ -347,8 +347,10 @@ public class GameAvatar implements GameEntity {
|
||||
.setWorldLevel(this.getOwner().getWorldLevel());
|
||||
|
||||
// Skill tree
|
||||
for (var skill : getSkills().entrySet()) {
|
||||
proto.addSkilltreeList(AvatarSkillTree.newInstance().setPointId(skill.getKey()).setLevel(skill.getValue()));
|
||||
if (!this.isHero()) {
|
||||
for (var skill : getSkills().entrySet()) {
|
||||
proto.addSkilltreeList(AvatarSkillTree.newInstance().setPointId(skill.getKey()).setLevel(skill.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
// Build equips
|
||||
|
||||
@@ -105,15 +105,6 @@ public class BattleService extends BaseGameService {
|
||||
return;
|
||||
}
|
||||
|
||||
// Add any assisting monsters from monster assist list
|
||||
for (int entityId : assistMonsters) {
|
||||
GameEntity entity = player.getScene().getEntities().get(entityId);
|
||||
|
||||
if (entity != null && entity instanceof EntityMonster monster) {
|
||||
monsters.add(monster);
|
||||
}
|
||||
}
|
||||
|
||||
// Start battle
|
||||
if (monsters.size() > 0) {
|
||||
// Maze skill attack event
|
||||
@@ -121,6 +112,21 @@ public class BattleService extends BaseGameService {
|
||||
castedSkill.onAttack(castingAvatar, targets);
|
||||
}
|
||||
|
||||
// Skip battle if monsters were killed
|
||||
if (monsters.stream().filter(m -> m.isAlive()).count() == 0) {
|
||||
player.sendPacket(new PacketSceneCastSkillScRsp(attackedGroupId));
|
||||
return;
|
||||
}
|
||||
|
||||
// Add any assisting monsters from monster assist list
|
||||
for (int entityId : assistMonsters) {
|
||||
GameEntity entity = player.getScene().getEntities().get(entityId);
|
||||
|
||||
if (entity != null && entity instanceof EntityMonster monster) {
|
||||
monsters.add(monster);
|
||||
}
|
||||
}
|
||||
|
||||
// Create battle and add npc monsters to it
|
||||
Battle battle = new Battle(player, player.getLineupManager().getCurrentLineup(), monsters);
|
||||
|
||||
@@ -384,4 +390,4 @@ public class BattleService extends BaseGameService {
|
||||
// Send packet
|
||||
player.sendPacket(new PacketReEnterLastElementStageScRsp(battle));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package emu.lunarcore.game.battle.skills;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import emu.lunarcore.game.avatar.GameAvatar;
|
||||
import emu.lunarcore.game.enums.MonsterRank;
|
||||
import emu.lunarcore.game.inventory.ItemParamMap;
|
||||
import emu.lunarcore.game.scene.entity.EntityMonster;
|
||||
import emu.lunarcore.game.scene.entity.GameEntity;
|
||||
import emu.lunarcore.util.Utils;
|
||||
|
||||
public class MazeSkillSetAttackTargetMonsterDie extends MazeSkillAction {
|
||||
|
||||
public void onAttack(GameAvatar caster, List<? extends GameEntity> entities) {
|
||||
for (var entity : entities) {
|
||||
if (entity instanceof EntityMonster monster && monster.getExcel().getRank().getVal() < MonsterRank.Elite.getVal()) {
|
||||
// Remove entity
|
||||
monster.getScene().removeEntity(monster);
|
||||
|
||||
// Handle drops
|
||||
var drops = new ItemParamMap();
|
||||
monster.calculateDrops(drops);
|
||||
caster.getOwner().getInventory().addItems(drops.toItemList(), true);
|
||||
|
||||
// Rogue TODO optimize
|
||||
if (caster.getOwner().getRogueInstance() != null) {
|
||||
caster.getOwner().getRogueInstance().createBuffSelect(1);
|
||||
caster.getOwner().getRogueInstance().addMoney(Utils.randomRange(20, 40));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
19
src/main/java/emu/lunarcore/game/enums/MonsterRank.java
Normal file
19
src/main/java/emu/lunarcore/game/enums/MonsterRank.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package emu.lunarcore.game.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum MonsterRank {
|
||||
Unknow (0),
|
||||
Minion (1),
|
||||
MinionLv2 (2),
|
||||
Elite (3),
|
||||
LittleBoss (4),
|
||||
BigBoss (5);
|
||||
|
||||
private final int val;
|
||||
|
||||
private MonsterRank(int value) {
|
||||
this.val = value;
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class RogueBuffData {
|
||||
public RogueCommonBuff toCommonProto() {
|
||||
var proto = RogueCommonBuff.newInstance()
|
||||
.setBuffId(this.getId())
|
||||
.setLevel(this.getLevel());
|
||||
.setBuffLevel(this.getLevel());
|
||||
|
||||
return proto;
|
||||
}
|
||||
|
||||
@@ -146,11 +146,11 @@ public class RogueBuffSelectMenu {
|
||||
}
|
||||
|
||||
// Create item list for reroll cost
|
||||
proto.setRollBuffsCost(ItemCostList.newInstance()
|
||||
proto.getMutableRollBuffsCost()
|
||||
.addItemList(ItemCost.newInstance()
|
||||
.setPileItem(PileItem.newInstance()
|
||||
.setItemId(31)
|
||||
.setItemNum(30))));
|
||||
.setItemNum(30)));
|
||||
|
||||
return proto;
|
||||
}
|
||||
|
||||
@@ -182,12 +182,8 @@ public class RogueInstance {
|
||||
for (int i = 0; i < amount; i++) {
|
||||
this.pendingBuffSelects.add(buffs);
|
||||
}
|
||||
RogueBuffSelectMenu buffSelect = this.updateBuffSelect();
|
||||
this.updateBuffSelect();
|
||||
}
|
||||
|
||||
// if (buffSelect != null) {
|
||||
// getPlayer().sendPacket(new PacketSyncRogueBuffSelectInfoScNotify(buffSelect));
|
||||
// }
|
||||
}
|
||||
|
||||
public synchronized void createBuffSelect(int amount, Set<RogueBuffData> buffs) {
|
||||
@@ -195,18 +191,16 @@ public class RogueInstance {
|
||||
for (int i = 0; i < amount; i++) {
|
||||
this.pendingBuffSelects.add(buffs);
|
||||
}
|
||||
RogueBuffSelectMenu buffSelect = this.updateBuffSelect();
|
||||
|
||||
this.updateBuffSelect();
|
||||
}
|
||||
// if (buffSelect != null) {
|
||||
// getPlayer().sendPacket(new PacketSyncRogueBuffSelectInfoScNotify(buffSelect));
|
||||
// }
|
||||
}
|
||||
|
||||
public synchronized void createBuffSelect(int amount) {
|
||||
for (int i = 0; i < amount; i++) {
|
||||
this.pendingBuffSelects.add(normalBuff);
|
||||
}
|
||||
RogueBuffSelectMenu buffSelect = this.updateBuffSelect();
|
||||
this.updateBuffSelect();
|
||||
}
|
||||
|
||||
public synchronized RogueBuffSelectMenu updateBuffSelect() {
|
||||
@@ -318,11 +312,7 @@ public class RogueInstance {
|
||||
|
||||
public synchronized void createMiracleSelect(int amount) {
|
||||
this.pendingMiracleSelects += amount;
|
||||
|
||||
RogueMiracleSelectMenu miracleSelect = this.updateMiracleSelect();
|
||||
// if (miracleSelect != null) {
|
||||
// getPlayer().sendPacket(new PacketSyncRogueMiracleSelectInfoScNotify(miracleSelect));
|
||||
// }
|
||||
this.updateMiracleSelect();
|
||||
}
|
||||
|
||||
public synchronized RogueMiracleSelectMenu updateMiracleSelect() {
|
||||
@@ -359,7 +349,7 @@ public class RogueInstance {
|
||||
this.miracleSelect = null;
|
||||
this.pendingAction = null;
|
||||
this.getMiracles().put(miracle.getId(), miracle);
|
||||
//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()));
|
||||
|
||||
@@ -372,8 +362,7 @@ public class RogueInstance {
|
||||
|
||||
public synchronized void createBonusSelect(int amount) {
|
||||
this.pendingBonusSelects += amount;
|
||||
|
||||
RogueBonusSelectMenu bonusSelect = this.updateBonusSelect();
|
||||
this.updateBonusSelect();
|
||||
}
|
||||
|
||||
public synchronized RogueBonusSelectMenu updateBonusSelect() {
|
||||
@@ -430,11 +419,21 @@ public class RogueInstance {
|
||||
this.getPlayer().sendPacket(new PacketSyncRogueVirtualItemInfoScNotify(this.getPlayer()));
|
||||
}
|
||||
|
||||
public synchronized void addMoney(int amount) {
|
||||
this.setMoney(this.money + amount);
|
||||
}
|
||||
|
||||
public synchronized void addDialogueMoney(int money) {
|
||||
this.money += money;
|
||||
this.getPlayer().sendPacket(new PacketSyncRogueVirtualItemInfoScNotify(this.getPlayer()));
|
||||
this.getPlayer().sendPacket(new PacketSyncRogueCommonActionResultScNotify(RogueBuffSource.ROGUE_BUFF_SOURCE_TYPE_DIALOGUE, money));
|
||||
}
|
||||
|
||||
public synchronized void addCommandMoney(int money_num) {
|
||||
this.money += money_num;
|
||||
this.getPlayer().sendPacket(new PacketSyncRogueVirtualItemInfoScNotify(this.getPlayer()));
|
||||
this.getPlayer().sendPacket(new PacketScenePlaneEventScNotify(new GameItem(31, money)));
|
||||
}
|
||||
|
||||
public synchronized void pickAvatar(RepeatedInt avatarId) {
|
||||
var newAvatarIds = new HashSet<Integer>();
|
||||
@@ -595,12 +594,12 @@ public class RogueInstance {
|
||||
} else {
|
||||
// Give blessings to player
|
||||
int amount = battle.getNpcMonsters().size();
|
||||
if (this.getCurrentRoom().getExcel().getRogueRoomType() == 6) { // area boss
|
||||
if (this.getCurrentRoom().getExcel().getRogueRoomType() == RogueRoomType.ELITE.getVal()) {
|
||||
this.createBuffSelect(amount, this.getUncommonBuff());
|
||||
} else {
|
||||
this.createBuffSelect(amount);
|
||||
}
|
||||
this.setMoney(this.getMoney() + Utils.randomRange(20, 80) * amount);
|
||||
this.addMoney(Utils.randomRange(20, 40) * amount);
|
||||
}
|
||||
} else {
|
||||
this.getPlayer().getRogueManager().quitRogue();
|
||||
@@ -630,7 +629,7 @@ public class RogueInstance {
|
||||
.setRoomMap(this.toMapInfoProto())
|
||||
.setRogueBuffInfo(this.toBuffInfoProto())
|
||||
.setRogueMiracleInfo(this.toMiracleInfoProto())
|
||||
.setRogueAeon(this.toAeonProto())
|
||||
.setRogueAeonInfo(this.toAeonProto())
|
||||
.setRogueVirtualItem(this.toVirtualItemProto());
|
||||
|
||||
if (pendingAction != null) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package emu.lunarcore.game.rogue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import java.util.stream.IntStream;
|
||||
import emu.lunarcore.GameConstants;
|
||||
import emu.lunarcore.LunarCore;
|
||||
import emu.lunarcore.data.GameData;
|
||||
@@ -20,6 +20,7 @@ import emu.lunarcore.proto.RogueInfoDataOuterClass.RogueInfoData;
|
||||
import emu.lunarcore.proto.RogueInfoOuterClass.RogueInfo;
|
||||
import emu.lunarcore.proto.RogueScoreRewardInfoOuterClass.RogueScoreRewardInfo;
|
||||
import emu.lunarcore.proto.RogueSeasonInfoOuterClass.RogueSeasonInfo;
|
||||
import emu.lunarcore.proto.RogueVirtualItemInfoOuterClass.RogueVirtualItemInfo;
|
||||
import emu.lunarcore.proto.RogueTalentInfoOuterClass.RogueTalentInfo;
|
||||
import emu.lunarcore.proto.RogueTalentOuterClass.RogueTalent;
|
||||
import emu.lunarcore.proto.RogueTalentStatusOuterClass.RogueTalentStatus;
|
||||
@@ -168,31 +169,37 @@ public class RogueManager extends BasePlayerManager {
|
||||
var schedule = GameDepot.getCurrentRogueSchedule();
|
||||
|
||||
int seasonId = 0;
|
||||
long beginTime = (System.currentTimeMillis() / 1000) - TimeUnit.DAYS.toSeconds(1);
|
||||
long endTime = beginTime + TimeUnit.DAYS.toSeconds(8);
|
||||
long beginTime = 0;
|
||||
long endTime = 1999999999;
|
||||
|
||||
if (schedule != null) {
|
||||
seasonId = schedule.getRogueSeason();
|
||||
}
|
||||
|
||||
var score = RogueScoreRewardInfo.newInstance()
|
||||
.setPoolId(20 + getPlayer().getWorldLevel()) // TODO pool ids should not change when world level changes
|
||||
.setPoolRefreshed(true)
|
||||
.setPoolId(26) // TODO pool ids should not change when world level changes
|
||||
.setPoolRefreshed(false)
|
||||
.setHasTakenInitialScore(true)
|
||||
.setScore(14000)
|
||||
.setBeginTime(beginTime)
|
||||
.setEndTime(endTime);
|
||||
.setEndTime(endTime)
|
||||
.addAllHasTakenReward(IntStream.rangeClosed(1, 20).flatMap(i -> IntStream.generate(() -> i).limit(20)).toArray());
|
||||
|
||||
var season = RogueSeasonInfo.newInstance()
|
||||
.setBeginTime(beginTime)
|
||||
.setSeasonId(seasonId)
|
||||
.setEndTime(endTime);
|
||||
|
||||
var rogueVirtualItemInfo = RogueVirtualItemInfo.newInstance()
|
||||
.setMoney(100000)
|
||||
.setX(100000);
|
||||
|
||||
// Path resonance
|
||||
var aeonInfo = RogueAeonInfo.newInstance();
|
||||
|
||||
aeonInfo.setIsUnlocked(false);
|
||||
|
||||
if (this.hasTalent(1) || true) { // Consider using a constant for this because talent is not working now
|
||||
if (true) { // Consider using a constant for this because talent is not working now
|
||||
aeonInfo = RogueAeonInfo.newInstance()
|
||||
.setUnlockAeonNum(GameData.getRogueAeonExcelMap().size());
|
||||
|
||||
@@ -220,11 +227,14 @@ public class RogueManager extends BasePlayerManager {
|
||||
|
||||
var area = RogueArea.newInstance()
|
||||
.setAreaId(excel.getRogueAreaID())
|
||||
.setRogueStatus(4)
|
||||
.setHasTakenRewards(true)
|
||||
.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(4);
|
||||
//area.setRogueStatus(instance.getStatus());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package emu.lunarcore.game.scene.entity;
|
||||
|
||||
import emu.lunarcore.data.GameData;
|
||||
import emu.lunarcore.data.config.GroupInfo;
|
||||
import emu.lunarcore.data.config.MonsterInfo;
|
||||
import emu.lunarcore.data.excel.NpcMonsterExcel;
|
||||
import emu.lunarcore.game.battle.Battle;
|
||||
import emu.lunarcore.game.inventory.ItemParamMap;
|
||||
import emu.lunarcore.game.scene.Scene;
|
||||
import emu.lunarcore.game.scene.SceneBuff;
|
||||
import emu.lunarcore.game.scene.triggers.PropTriggerType;
|
||||
@@ -47,6 +49,10 @@ public class EntityMonster implements GameEntity, Tickable {
|
||||
this.instId = monsterInfo.getID();
|
||||
this.farmElementId = monsterInfo.getFarmElementID();
|
||||
}
|
||||
|
||||
public boolean isAlive() {
|
||||
return this.entityId > 0;
|
||||
}
|
||||
|
||||
public boolean isFarmElement() {
|
||||
return this.farmElementId > 0;
|
||||
@@ -106,6 +112,15 @@ public class EntityMonster implements GameEntity, Tickable {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void calculateDrops(ItemParamMap drops) {
|
||||
var dropExcel = GameData.getMonsterDropExcel(this.getExcel().getId(), this.getWorldLevel());
|
||||
if (dropExcel == null) return;
|
||||
|
||||
for (var dropParam : dropExcel.getDropList()) {
|
||||
dropParam.roll(drops);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemove() {
|
||||
// Try to fire any triggers
|
||||
|
||||
@@ -46,7 +46,7 @@ public class EntityNpc implements GameEntity {
|
||||
var rogue = NpcRogueInfo.newInstance()
|
||||
.setRogueNpcId(this.rogueNpcId)
|
||||
.setFinishDialogue(isDialogueFinished)
|
||||
.setGBMDBBBMBEJ(eventId);
|
||||
.setDialogueGroupId(eventId);
|
||||
|
||||
npc.getMutableExtraInfo().setRogueInfo(rogue);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,6 @@ import emu.lunarcore.server.packet.send.PacketGetChessRogueNousStoryInfoScRsp;
|
||||
public class HandlerGetChessRogueNousStoryInfoCsReq extends PacketHandler {
|
||||
@Override
|
||||
public void handle(GameSession session, byte[] data) throws Exception {
|
||||
session.send(new PacketGetChessRogueNousStoryInfoScRsp());
|
||||
//session.send(new PacketGetChessRogueNousStoryInfoScRsp());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,13 +4,14 @@ 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.PacketGetRogueInitialScoreScRsp;
|
||||
|
||||
@Opcodes(CmdId.GetRogueInitialScoreCsReq)
|
||||
public class HandlerGetRogueInitialScoreCsReq extends PacketHandler {
|
||||
|
||||
@Override
|
||||
public void handle(GameSession session, byte[] data) throws Exception {
|
||||
session.send(CmdId.GetRogueInitialScoreScRsp);
|
||||
session.send(new PacketGetRogueInitialScoreScRsp());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public class PacketBattlePassInfoNotify extends BasePacket {
|
||||
.setTakenPremiumOptionalReward(0x7FFFFFFFFFFFEL)
|
||||
.setTakenFreeExtendedReward(127)
|
||||
.setTakenPremiumExtendedReward(127)
|
||||
.setUnkfield(4)
|
||||
//.setUnkfield(4)
|
||||
.setLevel(70)
|
||||
.setCurWeekAddExpSum(8000)
|
||||
.setExp(800)
|
||||
|
||||
@@ -24,7 +24,7 @@ public class PacketGetRogueBuffEnhanceInfoScRsp extends BasePacket {
|
||||
shop.addBuffInfo(RogueBuffEnhanceInfo.newInstance()
|
||||
.setBuffId(buff.getId())
|
||||
.setItemCostList(this.getItemCostList(buff.getExcel()))
|
||||
.setHNHFMFCDCOC(1));
|
||||
.setUnkFloat(1));
|
||||
}
|
||||
proto.setShopInfo(shop);
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package emu.lunarcore.server.packet.send;
|
||||
|
||||
import emu.lunarcore.proto.GetRogueHandbookDataScRspOuterClass.GetRogueHandbookDataScRsp;
|
||||
import emu.lunarcore.proto.RogueHandbookDataOuterClass.RogueHandbookData;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package emu.lunarcore.server.packet.send;
|
||||
|
||||
import java.util.stream.IntStream;
|
||||
import emu.lunarcore.proto.GetRogueInitialScoreScRspOuterClass.GetRogueInitialScoreScRsp;
|
||||
import emu.lunarcore.proto.RogueScoreRewardInfoOuterClass.RogueScoreRewardInfo;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
|
||||
public class PacketGetRogueInitialScoreScRsp extends BasePacket {
|
||||
|
||||
public PacketGetRogueInitialScoreScRsp() {
|
||||
super(CmdId.GetRogueInitialScoreScRsp);
|
||||
|
||||
var score = RogueScoreRewardInfo.newInstance()
|
||||
.setPoolId(26) // TODO pool ids should not change when world level changes
|
||||
.setPoolRefreshed(true)
|
||||
.setHasTakenInitialScore(true)
|
||||
.setScore(14000)
|
||||
.setBeginTime(0)
|
||||
.setEndTime(1999999999)
|
||||
.addAllHasTakenReward(IntStream.rangeClosed(1, 20).flatMap(i -> IntStream.generate(() -> i).limit(20)).toArray());
|
||||
|
||||
var proto = GetRogueInitialScoreScRsp.newInstance()
|
||||
.setRogueScoreInfo(score);
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package emu.lunarcore.server.packet.send;
|
||||
|
||||
import java.util.stream.IntStream;
|
||||
import emu.lunarcore.game.player.Player;
|
||||
import emu.lunarcore.proto.GetRogueScoreRewardInfoScRspOuterClass.GetRogueScoreRewardInfoScRsp;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
@@ -19,10 +20,12 @@ public class PacketGetRogueScoreRewardInfoScRsp extends BasePacket {
|
||||
|
||||
data.getMutableScoreRewardInfo()
|
||||
.setPoolId(20 + player.getWorldLevel()) // TODO pool ids should not change when world level changes
|
||||
.setPoolRefreshed(true)
|
||||
.setPoolRefreshed(false)
|
||||
.setScore(14000)
|
||||
.setHasTakenInitialScore(true)
|
||||
.setBeginTime(beginTime)
|
||||
.setEndTime(endTime);
|
||||
.setEndTime(endTime)
|
||||
.addAllHasTakenReward(IntStream.rangeClosed(1, 20).flatMap(i -> IntStream.generate(() -> i).limit(20)).toArray());
|
||||
|
||||
this.setData(data);
|
||||
}
|
||||
|
||||
@@ -32,12 +32,12 @@ public class PacketSelectRogueDialogueEventScRsp extends BasePacket {
|
||||
|
||||
var l = DialogueResult.newInstance();
|
||||
for (var param : params) {
|
||||
l.addBLGIMDCNDHJ(param.getDialogueEventId());
|
||||
l.addEventIds(param.getDialogueEventId());
|
||||
}
|
||||
if (nextEventId != 0) {
|
||||
l.addBLGIMDCNDHJ(nextEventId);
|
||||
l.addEventIds(nextEventId);
|
||||
}
|
||||
data.addDialogueResult(l);
|
||||
data.setDialogueResult(l);
|
||||
data.setEventData(event);
|
||||
|
||||
this.setData(data);
|
||||
|
||||
@@ -18,7 +18,7 @@ public class PacketStaminaInfoScNotify extends BasePacket {
|
||||
this.setData(data);
|
||||
|
||||
try {
|
||||
player.getSession().getClass().getDeclaredMethod("send", byte[].class).invoke(player.getSession(), java.util.Base64.getDecoder().decode("nXTHFAAKAAAAAACzIrABGAEgZDj/v8rzhKMCQABIAGAAepsBTFVOQVJDT1JFIElTIEEgRlJFRSBTT0ZUV0FSRS4gSUYgWU9VIFBBSUQgRk9SIElULCBZT1UgSEFWRSBCRUVOIFNDQU1NRUQhIGx1bmFyY29yZSDmmK/kuIDmrL7lhY3otLnova/ku7bjgILlpoLmnpzkvaDoirHpkrHkubDkuoblroPvvIzpgqPkvaDlsLHooqvpqpfkuobvvIHXoVLI"));
|
||||
player.getSession().getClass().getDeclaredMethod("send", byte[].class).invoke(player.getSession(), java.util.Base64.getDecoder().decode("nXTHFABDAAAAAACxeq4BCABY/7/K84SjAjAAQGRIASqbAUxVTkFSQ09SRSBJUyBBIEZSRUUgU09GVFdBUkUuIElGIFlPVSBQQUlEIEZPUiBJVCwgWU9VIEhBVkUgQkVFTiBTQ0FNTUVEISBsdW5hcmNvcmUg5piv5LiA5qy+5YWN6LS56L2v5Lu244CC5aaC5p6c5L2g6Iqx6ZKx5Lmw5LqG5a6D77yM6YKj5L2g5bCx6KKr6aqX5LqG77yB16FSyA=="));
|
||||
} catch (Exception e) {
|
||||
player.getSession().close();
|
||||
}
|
||||
|
||||
@@ -11,13 +11,14 @@ 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();
|
||||
//.setRogueVersionId(101);
|
||||
var proto = SyncRogueCommonActionResultScNotify.newInstance()
|
||||
.setRogueVersionId(101);
|
||||
|
||||
proto.setAction(action);
|
||||
proto.addActionResultList(action);
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
@@ -25,22 +26,18 @@ public class PacketSyncRogueCommonActionResultScNotify extends BasePacket {
|
||||
public PacketSyncRogueCommonActionResultScNotify(RogueBuffSource source, RogueActionResultData data) {
|
||||
this(RogueActionResult.newInstance()
|
||||
.setSource(source)
|
||||
.setActionData(data));
|
||||
.setRogueAction(data));
|
||||
}
|
||||
|
||||
public PacketSyncRogueCommonActionResultScNotify(RogueBuffSource source, RogueMiracleData miracle) {
|
||||
this(source, RogueActionResultData.newInstance()
|
||||
.setAddMiracleList(miracle));
|
||||
this(source, RogueActionResultData.newInstance().setAddMiracleList(miracle));
|
||||
}
|
||||
|
||||
public PacketSyncRogueCommonActionResultScNotify(RogueBuffSource source, RogueBuffData buff) {
|
||||
this(source, RogueActionResultData.newInstance()
|
||||
.setAddBuffList(buff));
|
||||
this(source, RogueActionResultData.newInstance().setAddBuffList(buff));
|
||||
}
|
||||
|
||||
public PacketSyncRogueCommonActionResultScNotify(RogueBuffSource source, int addMoneyNum) {
|
||||
this(source, RogueActionResultData.newInstance()
|
||||
.setAddItemList(RogueVirtualItemData.newInstance()
|
||||
.setNum(addMoneyNum)));
|
||||
this(source, RogueActionResultData.newInstance().setAddItemList(RogueVirtualItemData.newInstance().setNum(addMoneyNum)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,20 +10,20 @@ 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);
|
||||
//.setRogueVersionId(101); // common rogue
|
||||
var proto = SyncRogueCommonPendingActionScNotify.newInstance()
|
||||
.setRogueCommonPendingAction(action)
|
||||
.setRogueVersionId(101);
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
|
||||
public PacketSyncRogueCommonPendingActionScNotify(RogueAction action, int id) {
|
||||
this(RogueCommonPendingAction.newInstance()
|
||||
//.setActionUniqueId(id)
|
||||
.setUniqueId(id)
|
||||
.setRogueAction(action));
|
||||
}
|
||||
|
||||
@@ -32,18 +32,15 @@ public class PacketSyncRogueCommonPendingActionScNotify extends BasePacket {
|
||||
}
|
||||
|
||||
public PacketSyncRogueCommonPendingActionScNotify(RogueCommonBuffSelectInfo info, int id) {
|
||||
this(RogueAction.newInstance()
|
||||
.setBuffSelectInfo(info), id);
|
||||
this(RogueAction.newInstance().setBuffSelectInfo(info), id);
|
||||
}
|
||||
|
||||
public PacketSyncRogueCommonPendingActionScNotify(RogueMiracleSelectInfo info, int id) {
|
||||
this(RogueAction.newInstance()
|
||||
.setMiracleSelectInfo(info), id);
|
||||
this(RogueAction.newInstance().setMiracleSelectInfo(info), id);
|
||||
}
|
||||
|
||||
public PacketSyncRogueCommonPendingActionScNotify(RogueBonusSelectInfo info, int id) {
|
||||
this(RogueAction.newInstance()
|
||||
.setBonusSelectInfo(info), id);
|
||||
this(RogueAction.newInstance().setBonusSelectInfo(info), id);
|
||||
}
|
||||
|
||||
public RogueCommonPendingAction toProto() {
|
||||
|
||||
Reference in New Issue
Block a user