From 3b4454bc14386ef5a1f8dbb437e65dd9fa338d97 Mon Sep 17 00:00:00 2001 From: BaiSugar Date: Wed, 27 Apr 2022 10:02:41 +0800 Subject: [PATCH 1/4] Update README.md --- README.md | 3 ++- README_zh-CN.md | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d32e1ca9e..5b3ad9817 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,8 @@ There is a dummy user named "Server" in every player's friends list that you can | clearweapons | clearweapons | player.clearweapons | Client only | Deletes all unequipped and unlocked weapons, including yellow rarity ones from your inventory. | clearwpns | | drop | drop [amount] | server.drop | Client only | Drops an item around you. | `d` `dropitem` | | give | give [player] [amount] [level] | player.give | Both side | Gives item(s) to you or the specified player. | `g` `item` `giveitem` | -| givechar | givechar [level] | player.givechar | Both side | Gives the player a specified character. | givec | +| givechar | givechar | player.givechar | Both side | Gives the player a specified character. | givec | +| giveall | giveall | player.giveall | Both side | Gives all items. | givea | | godmode | godmode [uid] | player.godmode | Client only | Prevents you from taking damage. | | | heal | heal | player.heal | Client only | Heal all characters in your current team. | h | | help | help [command] | | Both side | Sends the help message or shows information about a specified command. | | diff --git a/README_zh-CN.md b/README_zh-CN.md index a2fe023b7..0eb761630 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -115,6 +115,7 @@ chmod +x gradlew | drop | drop <物品ID\|物品名称> [数量] | server.drop | 仅客户端 | 在指定玩家周围掉落指定物品 | `d` `dropitem` | | give | give [uid] <物品ID\|物品名称> [数量] [等级] | | | 给予指定玩家一定数量及等级的物品 | `g` `item` `giveitem` | | givechar | givechar <角色ID> [等级] | player.givechar | 均可使用 | 给予指定玩家对应角色 | givec | +| giveall | giveall <数量> | player.giveall | 均可使用 | 给予指定玩家全部物品 | givea | | godmode | godmode [uid] | player.godmode | 仅客户端 | 保护你不受到任何伤害(依然会被击退) | | | heal | heal | player.heal | 仅客户端 | 治疗队伍中所有角色 | h | | help | help [命令] | | 均可使用 | 显示帮助或展示指定命令的帮助 | | From 6a5d97a3faf76fb05916eab260d58f8edd42b1f4 Mon Sep 17 00:00:00 2001 From: BaiSugar Date: Wed, 27 Apr 2022 10:14:24 +0800 Subject: [PATCH 2/4] Update the command format of the usage (including source code) --- README.md | 2 +- README_zh-CN.md | 2 +- .../emu/grasscutter/command/commands/GiveAllCommand.java | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5b3ad9817..d3020e3ff 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ There is a dummy user named "Server" in every player's friends list that you can | drop | drop [amount] | server.drop | Client only | Drops an item around you. | `d` `dropitem` | | give | give [player] [amount] [level] | player.give | Both side | Gives item(s) to you or the specified player. | `g` `item` `giveitem` | | givechar | givechar | player.givechar | Both side | Gives the player a specified character. | givec | -| giveall | giveall | player.giveall | Both side | Gives all items. | givea | +| giveall | giveall [uid] [amount] | player.giveall | Both side | Gives all items. | givea | | godmode | godmode [uid] | player.godmode | Client only | Prevents you from taking damage. | | | heal | heal | player.heal | Client only | Heal all characters in your current team. | h | | help | help [command] | | Both side | Sends the help message or shows information about a specified command. | | diff --git a/README_zh-CN.md b/README_zh-CN.md index 0eb761630..c1e90c27d 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -115,7 +115,7 @@ chmod +x gradlew | drop | drop <物品ID\|物品名称> [数量] | server.drop | 仅客户端 | 在指定玩家周围掉落指定物品 | `d` `dropitem` | | give | give [uid] <物品ID\|物品名称> [数量] [等级] | | | 给予指定玩家一定数量及等级的物品 | `g` `item` `giveitem` | | givechar | givechar <角色ID> [等级] | player.givechar | 均可使用 | 给予指定玩家对应角色 | givec | -| giveall | giveall <数量> | player.giveall | 均可使用 | 给予指定玩家全部物品 | givea | +| giveall | giveall [uid] [数量] | player.giveall | 均可使用 | 给予指定玩家全部物品 | givea | | godmode | godmode [uid] | player.godmode | 仅客户端 | 保护你不受到任何伤害(依然会被击退) | | | heal | heal | player.heal | 仅客户端 | 治疗队伍中所有角色 | h | | help | help [命令] | | 均可使用 | 显示帮助或展示指定命令的帮助 | | diff --git a/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java b/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java index 47ac08405..def5c9fe0 100644 --- a/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java @@ -13,7 +13,7 @@ import emu.grasscutter.game.inventory.ItemType; import java.util.*; -@Command(label = "giveall", usage = "giveall [player] ", +@Command(label = "giveall", usage = "giveall [player] [amount]", description = "Gives all items", aliases = {"givea"}, permission = "player.giveall", threading = true) public class GiveAllCommand implements CommandHandler { @@ -59,7 +59,7 @@ public class GiveAllCommand implements CommandHandler { break; default: // invalid - CommandHandler.sendMessage(null, "Usage: giveall [player] "); + CommandHandler.sendMessage(null, "Usage: giveall [player] [amount]"); return; } @@ -142,7 +142,7 @@ public class GiveAllCommand implements CommandHandler { } } - if (testItemsList.contains(itemId)) { + if (testItemsList.contains(itemId)) { return true; } @@ -175,7 +175,6 @@ public class GiveAllCommand implements CommandHandler { new Range(2017, 2029), // new Range(108001, 108387) //food }; - private static final Integer[] testItemsIds = new Integer[] { 210, 211, 314, 315, 317, 1005, 1007, 1105, 1107, 1201, 1202, 2800, 100001, 100002, 100244, 100305, 100312, 100313, 101212, 11411, 11506, 11507, 11508, 12505, From 76098cdb7142a875bc586f6d731488eb072564ff Mon Sep 17 00:00:00 2001 From: BaiSugar Date: Fri, 29 Apr 2022 14:13:09 +0800 Subject: [PATCH 3/4] remove useless items --- .../command/commands/GiveAllCommand.java | 35 ++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java b/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java index 648828643..94f28dbbc 100644 --- a/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java @@ -5,6 +5,8 @@ import emu.grasscutter.command.Command; import emu.grasscutter.command.CommandHandler; import emu.grasscutter.data.GameData; import emu.grasscutter.data.def.AvatarData; +import emu.grasscutter.data.def.AvatarSkillData; +import emu.grasscutter.data.def.AvatarSkillDepotData; import emu.grasscutter.data.def.ItemData; import emu.grasscutter.game.avatar.Avatar; import emu.grasscutter.game.inventory.GameItem; @@ -83,9 +85,6 @@ public class GiveAllCommand implements CommandHandler { Avatar avatar = new Avatar(avatarData); avatar.setLevel(90); avatar.setPromoteLevel(6); - for (int i = 1; i <= 6; ++i) { - avatar.getTalentIdList().add((avatar.getAvatarId() - 10000000) * 10 + i); - } // This will handle stats and talents avatar.recalcStats(); player.addAvatar(avatar); @@ -98,7 +97,7 @@ public class GiveAllCommand implements CommandHandler { if (isTestItem(itemdata.getId())) continue; if (itemdata.isEquip()) { - for (int i = 0; i < 10; ++i) { + for (int i = 0; i < 5; ++i) { GameItem item = new GameItem(itemdata); if (itemdata.getItemType() == ItemType.ITEM_WEAPON) { item.setLevel(90); @@ -114,7 +113,7 @@ public class GiveAllCommand implements CommandHandler { itemList.add(item); } } - int packetNum = 20; + int packetNum = 10; int itemLength = itemList.size(); int number = itemLength / packetNum; int remainder = itemLength % packetNum; @@ -171,15 +170,27 @@ public class GiveAllCommand implements CommandHandler { private static final Range[] testItemRanges = new Range[] { new Range(106, 139), new Range(1000, 1099), - new Range(2001, 2008), - new Range(2017, 2029), - // new Range(108001, 108387) //food + new Range(2001, 3022), + new Range(23300, 23340), + new Range(23383, 23385), + new Range(78310, 78554), + new Range(99310, 99554), + new Range(100001, 100187), + new Range(100210, 100214), + new Range(100303, 100398), + new Range(100414, 100425), + new Range(100454, 103008), + new Range(109000, 109492), + new Range(115001, 118004), + new Range(141001, 141072), + new Range(220050, 221016), }; private static final Integer[] testItemsIds = new Integer[] { - 210, 211, 314, 315, 317, 1005, 1007, 1105, 1107, 1201, 1202, 2800, - 100001, 100002, 100244, 100305, 100312, 100313, 101212, 11411, 11506, 11507, 11508, 12505, - 12506, 12508, 12509, 13503, 13506, 14411, 14503, 14505, 14508, 15411, 15504, 15505, - 15506, 15508, 20001, 10002, 10003, 10004, 10005, 10006, 10008 //9 + 210, 211, 314, 315, 317, 1005, 1007, 1105, 1107, 1201, 1202,10366, + 101212, 11411, 11506, 11507, 11508, 12505, 12506, 12508, 12509, 13503, + 13506, 14411, 14503, 14505, 14508, 15411, 15504, 15505, 15506, 15508, + 20001, 10002, 10003, 10004, 10005, 10006, 10008,100231,100232,100431, + 101689,105001,105004, 106000,106001,108000,110000 }; private static final Collection testItemsList = Arrays.asList(testItemsIds); From 1bd8d871bb506ae6544dfa610327ecb37a771b5e Mon Sep 17 00:00:00 2001 From: BaiSugar Date: Fri, 29 Apr 2022 14:18:32 +0800 Subject: [PATCH 4/4] remove useless items --- .../java/emu/grasscutter/command/commands/GiveAllCommand.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java b/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java index 94f28dbbc..94437e0e2 100644 --- a/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java @@ -5,8 +5,6 @@ import emu.grasscutter.command.Command; import emu.grasscutter.command.CommandHandler; import emu.grasscutter.data.GameData; import emu.grasscutter.data.def.AvatarData; -import emu.grasscutter.data.def.AvatarSkillData; -import emu.grasscutter.data.def.AvatarSkillDepotData; import emu.grasscutter.data.def.ItemData; import emu.grasscutter.game.avatar.Avatar; import emu.grasscutter.game.inventory.GameItem;