Compare commits

...

5 Commits

Author SHA1 Message Date
leonier-test
61f849dbd8 Ruin Guards/Hunters/Graders should drop Chaos Device series instead of Chaos Gear series. 2022-06-03 06:12:25 -07:00
leonier-test
262c9c4bf4 Fix default Shop.json (for Mondstadt General Goods) 2022-06-03 06:12:04 -07:00
Paimon2022
1496553c44 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].
2022-06-03 03:20:07 -07:00
Paimon2022
5ba2ee1b50 Add coordinate support for spawn command (monster only)
Now the spawn command is: spawn <entityID> [amount] [level(monster only)] <x> <y> <z>(monster only, optional)
The coordinate is optional
2022-06-03 03:19:59 -07:00
zhaodice
ac50e78b2c skipping right characters panel for Android 2022-06-03 02:42:17 -07:00
6 changed files with 48 additions and 29 deletions

View File

@ -23,7 +23,7 @@ import java.util.Random;
import static emu.grasscutter.Configuration.*;
import static emu.grasscutter.utils.Language.translate;
@Command(label = "spawn", usage = "spawn <entityId> [amount] [level(monster only)]", permission = "server.spawn", permissionTargeted = "server.spawn.others", description = "commands.spawn.description")
@Command(label = "spawn", usage = "spawn <entityId> [amount] [level(monster only)] <x> <y> <z>(monster only, optional)", permission = "server.spawn", permissionTargeted = "server.spawn.others", description = "commands.spawn.description")
public final class SpawnCommand implements CommandHandler {
@Override
@ -31,7 +31,16 @@ public final class SpawnCommand implements CommandHandler {
int id = 0; // This is just to shut up the linter, it's not a real default
int amount = 1;
int level = 1;
float x = 0, y = 0, z = 0;
switch (args.size()) {
case 6:
try {
x = Float.parseFloat(args.get(3));
y = Float.parseFloat(args.get(4));
z = Float.parseFloat(args.get(5));
} catch (NumberFormatException ignored) {
CommandHandler.sendMessage(sender, translate(sender, "commands.execution.argument_error"));
} // Fallthrough
case 3:
try {
level = Integer.parseInt(args.get(2));
@ -77,6 +86,9 @@ public final class SpawnCommand implements CommandHandler {
double maxRadius = Math.sqrt(amount * 0.2 / Math.PI);
for (int i = 0; i < amount; i++) {
Position pos = GetRandomPositionInCircle(targetPlayer.getPos(), maxRadius).addY(3);
if(x != 0 && y != 0 && z != 0) {
pos = GetRandomPositionInCircle(new Position(x, y, z), maxRadius).addY(3);
}
GameEntity entity = null;
if (itemData != null) {
entity = new EntityItem(scene, null, itemData, pos, 1, true);

View File

@ -94,6 +94,7 @@ public enum OpenState {
OPEN_STATE_GUIDE_RELICRESOLVE(84),
OPEN_STATE_GUIDE_GGUIDE(85),
OPEN_STATE_GUIDE_GGUIDE_HINT(86),
OPEN_STATE_GUIDE_RIGHT_TEAM(90), // mobile phone only!
OPEN_STATE_CITY_REPUATION_MENGDE(800),
OPEN_STATE_CITY_REPUATION_LIYUE(801),
OPEN_STATE_CITY_REPUATION_UI_HINT(802),

View File

@ -465,7 +465,11 @@ public class Scene {
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.setGroupId(entry.getGroup().getGroupId());
entity.setPoseId(entry.getPoseId());

View File

@ -132794,21 +132794,21 @@
"maxWeight": 1
},
{
"itemId": 112047,
"itemId": 112023,
"minCount": 1,
"maxCount": 3,
"minWeight": 2000,
"maxWeight": 6000
},
{
"itemId": 112048,
"itemId": 112024,
"minCount": 1,
"maxCount": 1,
"minWeight": 8001,
"maxWeight": 9500
},
{
"itemId": 112049,
"itemId": 112025,
"minCount": 1,
"maxCount": 1,
"minWeight": 9501,
@ -132855,21 +132855,21 @@
"maxWeight": 1
},
{
"itemId": 112047,
"itemId": 112023,
"minCount": 1,
"maxCount": 3,
"minWeight": 2000,
"maxWeight": 6000
},
{
"itemId": 112048,
"itemId": 112024,
"minCount": 1,
"maxCount": 1,
"minWeight": 8001,
"maxWeight": 9500
},
{
"itemId": 112049,
"itemId": 112025,
"minCount": 1,
"maxCount": 1,
"minWeight": 9501,
@ -132916,21 +132916,21 @@
"maxWeight": 1
},
{
"itemId": 112047,
"itemId": 112023,
"minCount": 1,
"maxCount": 3,
"minWeight": 2000,
"maxWeight": 6000
},
{
"itemId": 112048,
"itemId": 112024,
"minCount": 1,
"maxCount": 1,
"minWeight": 8001,
"maxWeight": 9500
},
{
"itemId": 112049,
"itemId": 112025,
"minCount": 1,
"maxCount": 1,
"minWeight": 9501,
@ -132977,21 +132977,21 @@
"maxWeight": 1
},
{
"itemId": 112047,
"itemId": 112023,
"minCount": 1,
"maxCount": 3,
"minWeight": 2000,
"maxWeight": 6000
},
{
"itemId": 112048,
"itemId": 112024,
"minCount": 1,
"maxCount": 1,
"minWeight": 8001,
"maxWeight": 9500
},
{
"itemId": 112049,
"itemId": 112025,
"minCount": 1,
"maxCount": 1,
"minWeight": 9501,
@ -133038,21 +133038,21 @@
"maxWeight": 1
},
{
"itemId": 112047,
"itemId": 112023,
"minCount": 1,
"maxCount": 3,
"minWeight": 2000,
"maxWeight": 6000
},
{
"itemId": 112048,
"itemId": 112024,
"minCount": 1,
"maxCount": 1,
"minWeight": 8001,
"maxWeight": 9500
},
{
"itemId": 112049,
"itemId": 112025,
"minCount": 1,
"maxCount": 1,
"minWeight": 9501,
@ -133099,21 +133099,21 @@
"maxWeight": 1
},
{
"itemId": 112047,
"itemId": 112023,
"minCount": 1,
"maxCount": 3,
"minWeight": 2000,
"maxWeight": 6000
},
{
"itemId": 112048,
"itemId": 112024,
"minCount": 1,
"maxCount": 1,
"minWeight": 8001,
"maxWeight": 9500
},
{
"itemId": 112049,
"itemId": 112025,
"minCount": 1,
"maxCount": 1,
"minWeight": 9501,

View File

@ -5,8 +5,8 @@
{
"goodsId": 1004202,
"goodsItem": {
"Id": 202,
"Count": 1000000
"id": 202,
"count": 1000000
},
"scoin": 1,
"buyLimit": 500,
@ -16,17 +16,18 @@
"maxLevel": 99,
"costItemList": [
{
"Id": 223,
"Count": 100
"id": 223,
"count": 100
}
]
},
{
"goodsId": 10048006,
"goodsItem": {
"Id": 108006,
"Count": 20
"id": 108006,
"count": 20
},
"costItemList": [],
"scoin": 100,
"hcoin": 100,
"mcoin": 100,
@ -39,9 +40,10 @@
{
"goodsId": 10048033,
"goodsItem": {
"Id": 108033,
"Count": 20
"id": 108033,
"count": 20
},
"costItemList": [],
"scoin": 1,
"buyLimit": 50000,
"beginTime": 1575129600,

View File

@ -304,7 +304,7 @@
"description": "Sets your world level (Relog to see proper effects)"
},
"spawn": {
"usage": "Usage: spawn <entityID> [amount] [level(monster only)]",
"usage": "Usage: spawn <entityID> [amount] [level(monster only)] <x> <y> <z>(monster only, optional)",
"success": "Spawned %s of %s.",
"limit_reached": "Scene spawn limit reached. Spawning %s entities instead.",
"description": "Spawns an entity near you"