Compare commits

..

No commits in common. "61f849dbd84f495a2ca7dec54725ce231dba63a3" and "bade510c090f6e2ebb3c1ccb6bf5189b3cefb8b4" have entirely different histories.

6 changed files with 29 additions and 48 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)] <x> <y> <z>(monster only, optional)", permission = "server.spawn", permissionTargeted = "server.spawn.others", description = "commands.spawn.description")
@Command(label = "spawn", usage = "spawn <entityId> [amount] [level(monster only)]", permission = "server.spawn", permissionTargeted = "server.spawn.others", description = "commands.spawn.description")
public final class SpawnCommand implements CommandHandler {
@Override
@ -31,16 +31,7 @@ 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));
@ -86,9 +77,6 @@ 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,7 +94,6 @@ 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,11 +465,7 @@ public class Scene {
continue;
}
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);
EntityMonster entity = new EntityMonster(this, data, entry.getPos(), worldLevelOverride > 0 ? worldLevelOverride : entry.getLevel());
entity.getRotation().set(entry.getRot());
entity.setGroupId(entry.getGroup().getGroupId());
entity.setPoseId(entry.getPoseId());

View File

@ -132794,21 +132794,21 @@
"maxWeight": 1
},
{
"itemId": 112023,
"itemId": 112047,
"minCount": 1,
"maxCount": 3,
"minWeight": 2000,
"maxWeight": 6000
},
{
"itemId": 112024,
"itemId": 112048,
"minCount": 1,
"maxCount": 1,
"minWeight": 8001,
"maxWeight": 9500
},
{
"itemId": 112025,
"itemId": 112049,
"minCount": 1,
"maxCount": 1,
"minWeight": 9501,
@ -132855,21 +132855,21 @@
"maxWeight": 1
},
{
"itemId": 112023,
"itemId": 112047,
"minCount": 1,
"maxCount": 3,
"minWeight": 2000,
"maxWeight": 6000
},
{
"itemId": 112024,
"itemId": 112048,
"minCount": 1,
"maxCount": 1,
"minWeight": 8001,
"maxWeight": 9500
},
{
"itemId": 112025,
"itemId": 112049,
"minCount": 1,
"maxCount": 1,
"minWeight": 9501,
@ -132916,21 +132916,21 @@
"maxWeight": 1
},
{
"itemId": 112023,
"itemId": 112047,
"minCount": 1,
"maxCount": 3,
"minWeight": 2000,
"maxWeight": 6000
},
{
"itemId": 112024,
"itemId": 112048,
"minCount": 1,
"maxCount": 1,
"minWeight": 8001,
"maxWeight": 9500
},
{
"itemId": 112025,
"itemId": 112049,
"minCount": 1,
"maxCount": 1,
"minWeight": 9501,
@ -132977,21 +132977,21 @@
"maxWeight": 1
},
{
"itemId": 112023,
"itemId": 112047,
"minCount": 1,
"maxCount": 3,
"minWeight": 2000,
"maxWeight": 6000
},
{
"itemId": 112024,
"itemId": 112048,
"minCount": 1,
"maxCount": 1,
"minWeight": 8001,
"maxWeight": 9500
},
{
"itemId": 112025,
"itemId": 112049,
"minCount": 1,
"maxCount": 1,
"minWeight": 9501,
@ -133038,21 +133038,21 @@
"maxWeight": 1
},
{
"itemId": 112023,
"itemId": 112047,
"minCount": 1,
"maxCount": 3,
"minWeight": 2000,
"maxWeight": 6000
},
{
"itemId": 112024,
"itemId": 112048,
"minCount": 1,
"maxCount": 1,
"minWeight": 8001,
"maxWeight": 9500
},
{
"itemId": 112025,
"itemId": 112049,
"minCount": 1,
"maxCount": 1,
"minWeight": 9501,
@ -133099,21 +133099,21 @@
"maxWeight": 1
},
{
"itemId": 112023,
"itemId": 112047,
"minCount": 1,
"maxCount": 3,
"minWeight": 2000,
"maxWeight": 6000
},
{
"itemId": 112024,
"itemId": 112048,
"minCount": 1,
"maxCount": 1,
"minWeight": 8001,
"maxWeight": 9500
},
{
"itemId": 112025,
"itemId": 112049,
"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,18 +16,17 @@
"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,
@ -40,10 +39,9 @@
{
"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)] <x> <y> <z>(monster only, optional)",
"usage": "Usage: spawn <entityID> [amount] [level(monster only)]",
"success": "Spawned %s of %s.",
"limit_reached": "Scene spawn limit reached. Spawning %s entities instead.",
"description": "Spawns an entity near you"