Spawn default monsters with different levels according to data/Spawns.json when worldLevelOverride is not zero.

For example, in world with worldlevel 8, base monster level is 90 according to resources/ExcelBinOutput/WorldLevelExcelConfigData.json,
monster level bias in data/Spawns.json belongs to [1,32], so the monster level would belong to [69, 100].
This commit is contained in:
Paimon2022 2022-06-03 08:38:22 +08:00 committed by Melledy
parent 4119f8b787
commit a19e7c6db6

View File

@ -465,7 +465,11 @@ public class Scene {
continue; continue;
} }
EntityMonster entity = new EntityMonster(this, data, entry.getPos(), worldLevelOverride > 0 ? worldLevelOverride : entry.getLevel()); int level = worldLevelOverride > 0 ? worldLevelOverride + entry.getLevel() - 22 : entry.getLevel();
level = level >= 100 ? 100 : level;
level = level <= 0 ? 1 : level;
EntityMonster entity = new EntityMonster(this, data, entry.getPos(), level);
entity.getRotation().set(entry.getRot()); entity.getRotation().set(entry.getRot());
entity.setGroupId(entry.getGroup().getGroupId()); entity.setGroupId(entry.getGroup().getGroupId());
entity.setPoseId(entry.getPoseId()); entity.setPoseId(entry.getPoseId());