Fixed ::dps command taking the melee attack speed of the staff instead of the autocast speed when using magic.

Also shortened the command description so it fits on the ::commands list.
This commit is contained in:
randy 2025-08-26 21:15:55 -06:00
parent bfa62864fa
commit e9085a8270

View file

@ -651,7 +651,7 @@ class MiscCommandSet : CommandSet(Privilege.ADMIN){
} }
//Snowscape custom commands //Snowscape custom commands
define("dps", Privilege.STANDARD, "::dps <lt>NPC ID<gt>", "Calculates and prints your current damage, accuracy, and DPS against the given NPC ID."){ player, args -> define("dps", Privilege.STANDARD, "::dps <lt>NPC ID<gt>", "Calculates current DPS against the given NPC target."){ player, args ->
// If NPC ID is specified, save as attribute. If unspecified, use last saved ID (defaults to Chicken) // If NPC ID is specified, save as attribute. If unspecified, use last saved ID (defaults to Chicken)
if (args.size > 1) { if (args.size > 1) {
setAttribute(player, "snowscape:dpscalc", args[1].toInt()) setAttribute(player, "snowscape:dpscalc", args[1].toInt())
@ -671,6 +671,7 @@ class MiscCommandSet : CommandSet(Privilege.ADMIN){
attackSpeed-- attackSpeed--
} }
} else if (handler.type == CombatStyle.MAGIC) { } else if (handler.type == CombatStyle.MAGIC) {
attackSpeed = 5
val spell = player.getProperties().getAutocastSpell() val spell = player.getProperties().getAutocastSpell()
maxHit = if (spell != null) spell.getMaximumImpact(player, npc, null) else 0 maxHit = if (spell != null) spell.getMaximumImpact(player, npc, null) else 0
} }