From af9aaad94c1dd15244f551a5862ed3749ce6e75b Mon Sep 17 00:00:00 2001 From: Sam Marder Date: Sat, 20 Jun 2026 13:47:04 +0000 Subject: [PATCH] ::rolldrops now takes a boolean final argument for depositing into bank instead --- .../command/sets/DevelopmentCommandSet.kt | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/Server/src/main/core/game/system/command/sets/DevelopmentCommandSet.kt b/Server/src/main/core/game/system/command/sets/DevelopmentCommandSet.kt index 65ffe1369..25ef32fef 100644 --- a/Server/src/main/core/game/system/command/sets/DevelopmentCommandSet.kt +++ b/Server/src/main/core/game/system/command/sets/DevelopmentCommandSet.kt @@ -232,18 +232,35 @@ class DevelopmentCommandSet : CommandSet(Privilege.ADMIN) { writer.close() } - define("rolldrops", Privilege.ADMIN, "::rolldrops NPC ID AMOUNT", "Rolls the given NPC drop table AMOUNT times.") { player: Player, args: Array -> - if(args.size < 2){ - reject(player,"Usage: ::rolldrops npcid amount") + define( + "rolldrops", + Privilege.ADMIN, + "::rolldrops NPC ID AMOUNT [true|false]", + "Rolls the given NPC drop table AMOUNT times. Add true to persist the items in your bank." + ) { player: Player, args: Array -> + if (args.size < 3) { + reject(player, "Usage: ::rolldrops npcid amount [true|false]") } - val container = player.dropLog val npcId = args[1].toInt() val amount = args[2].toInt() + val container = when (args.getOrNull(3)) { + "true" -> player.bank + "false", null -> { + player.dropLog.clear() + player.dropLog + } + + else -> { + reject(player, "Usage: ::rolldrops npcid amount [true|false]") + return@define + } + + } - container.clear() val drops = NPCDefinition.forId(npcId).dropTables.table.roll(player, amount) - for(drop in drops) container.add(drop, false) + + for (drop in drops) container.add(drop, false) container.open(player) }