Add update commands for cost configs

Part of #6
This commit is contained in:
zontreck 2025-06-07 13:47:46 -07:00
parent 8d875653e0
commit c269066a26
5 changed files with 213 additions and 7 deletions

View file

@ -104,7 +104,8 @@ namespace AriasServerUtils
api.ChatCommands.Create("home").RequiresPlayer().WithArgs(parsers.OptionalWord("name")).WithDescription("Teleports you to home").RequiresPrivilege(Privilege.chat).HandleWith(Events.HandleGoHome).WithAlias("h");
api.ChatCommands.Create("delhome").RequiresPlayer().WithArgs(parsers.OptionalWord("name")).WithDescription("Deletes a home entry").RequiresPrivilege(Privilege.chat).HandleWith(Events.HandleDelHome).WithAlias("dh");
api.ChatCommands.Create("homes").RequiresPlayer().WithDescription("Lists your homes").RequiresPrivilege(Privilege.chat).HandleWith(Events.HandleListHomes).WithAlias("lh");
api.ChatCommands.Create("sethomemount").RequiresPlayer().WithArgs(parsers.OptionalWord("name")).WithDescription("Create a home with the ability to take a mount with you. Costs [undefined] gears.").RequiresPrivilege(Privilege.chat).HandleWith(Events.HandleSetHome).WithAlias("shm", "shb");
api.ChatCommands.Create("sethomemount").RequiresPlayer().WithArgs(parsers.OptionalWord("name")).WithDescription($"Create a home with the ability to take a mount with you.").RequiresPrivilege(Privilege.chat).HandleWith(Events.HandleSetHome).WithAlias("shm", "shb");
api.ChatCommands.Create("setwarpmount").RequiresPlayer().WithArgs(parsers.OptionalWord("name")).WithDescription($"Create a warp with the ability to take a mount with you.").RequiresPrivilege(Privilege.chat).HandleWith(Events.HandleWarpUpdate).WithAlias("swm", "swb");
api.ChatCommands.Create("asu")
.RequiresPrivilege(Privilege.chat)
@ -187,6 +188,102 @@ namespace AriasServerUtils
.WithDescription("Enables or disables dropping soil when breaking farmland")
.HandleWith(Events.HandleUpdateASUFarmlandDrop)
.EndSubCommand()
.BeginSubCommand("costs")
.WithDescription("Update gear costs for various commands")
.BeginSubCommand("reset")
.RequiresPrivilege(Privilege.controlserver)
.WithDescription("Resets all command costs to factory defaults")
.HandleWith(Events.HandleASUUpdateCmdCostReset)
.EndSubCommand()
.BeginSubCommand("spawn")
.RequiresPrivilege(Privilege.controlserver)
.WithDescription("Update spawn command cost")
.WithArgs(
parsers.OptionalInt("cost", CommandCosts.defaults[CommandCosts.CostType.spawn])
)
.HandleWith(Events.HandleASUUpdateCommandCostSpawn)
.EndSubCommand()
.BeginSubCommand("rtp")
.RequiresPrivilege(Privilege.controlserver)
.WithDescription("Update rtp command cost")
.WithArgs(
parsers.OptionalInt("cost", CommandCosts.defaults[CommandCosts.CostType.rtp])
)
.HandleWith(Events.HandleASUUpdateCommandCostRTP)
.EndSubCommand()
.BeginSubCommand("back")
.RequiresPrivilege(Privilege.controlserver)
.WithDescription("Update back command cost")
.WithArgs(
parsers.OptionalInt("cost", CommandCosts.defaults[CommandCosts.CostType.back])
)
.HandleWith(Events.HandleASUUpdateCommandCostBack)
.EndSubCommand()
.BeginSubCommand("sethome")
.RequiresPrivilege(Privilege.controlserver)
.WithDescription("Update sethome command cost")
.WithArgs(
parsers.OptionalInt("cost", CommandCosts.defaults[CommandCosts.CostType.sethome])
)
.HandleWith(Events.HandleASUUpdateCommandCostSetHome)
.EndSubCommand()
.BeginSubCommand("home")
.RequiresPrivilege(Privilege.controlserver)
.WithDescription("Update home command cost")
.WithArgs(
parsers.OptionalInt("cost", CommandCosts.defaults[CommandCosts.CostType.home])
)
.HandleWith(Events.HandleASUUpdateCommandCostHome)
.EndSubCommand()
.BeginSubCommand("delhome")
.RequiresPrivilege(Privilege.controlserver)
.WithDescription("Update delhome command cost")
.WithArgs(
parsers.OptionalInt("cost", CommandCosts.defaults[CommandCosts.CostType.delhome])
)
.HandleWith(Events.HandleASUUpdateCommandCostDelHome)
.EndSubCommand()
.BeginSubCommand("sethomemount")
.RequiresPrivilege(Privilege.controlserver)
.WithDescription("Update sethomemount command cost")
.WithArgs(
parsers.OptionalInt("cost", CommandCosts.defaults[CommandCosts.CostType.sethomemount])
)
.HandleWith(Events.HandleASUUpdateCommandCostSetHomeMount)
.EndSubCommand()
.BeginSubCommand("warp")
.RequiresPrivilege(Privilege.controlserver)
.WithDescription("Update warp command cost")
.WithArgs(
parsers.OptionalInt("cost", CommandCosts.defaults[CommandCosts.CostType.warp])
)
.HandleWith(Events.HandleASUUpdateCommandCostWarp)
.EndSubCommand()
.BeginSubCommand("setwarp")
.RequiresPrivilege(Privilege.controlserver)
.WithDescription("Update setwarp command cost")
.WithArgs(
parsers.OptionalInt("cost", CommandCosts.defaults[CommandCosts.CostType.setwarp])
)
.HandleWith(Events.HandleASUUpdateCommandCostSetWarp)
.EndSubCommand()
.BeginSubCommand("delwarp")
.RequiresPrivilege(Privilege.controlserver)
.WithDescription("Update delwarp command cost")
.WithArgs(
parsers.OptionalInt("cost", CommandCosts.defaults[CommandCosts.CostType.delwarp])
)
.HandleWith(Events.HandleASUUpdateCommandCostDelWarp)
.EndSubCommand()
.BeginSubCommand("setwarpmount")
.RequiresPrivilege(Privilege.controlserver)
.WithDescription("Update setwarpmount command cost")
.WithArgs(
parsers.OptionalInt("cost", CommandCosts.defaults[CommandCosts.CostType.setwarpmount])
)
.HandleWith(Events.HandleASUUpdateCommandCostSetWarpMount)
.EndSubCommand()
.EndSubCommand()
.BeginSubCommand("cooldowns")
.WithDescription("Commands related to all the various cooldowns")
.BeginSubCommand("back")