This commit is contained in:
psyopcutie 2026-07-18 20:44:55 +02:00
parent 1e5ada15af
commit da751eb674
2 changed files with 4244 additions and 0 deletions

View file

@ -11,6 +11,7 @@ import core.game.world.update.flag.context.Animation
import core.plugin.Initializable
import core.game.system.command.CommandPlugin.Companion.toInteger
import core.game.system.command.Privilege
import core.game.system.config.HumanoidAnimationIds
import core.game.world.GameWorld
import java.util.*
@ -54,6 +55,35 @@ class AnimationCommandSet : CommandSet(Privilege.ADMIN) {
}
}
/** Same as ::anims but only plays animations compatible with the player/humanoid skeleton. */
define("panims", Privilege.ADMIN, "::panims <From Animation ID> <To Animation ID> <(opt) Duration Per Animation>", "Plays animations from the From ID to the To ID, with a delay of 3 between animations, unless specified otherwise"){ player, args ->
if (args.size < 3) {
reject(player, "Syntax error: ::panims <From Animation ID> <To Animation ID> <(opt) Duration Per Animation>")
}
val animationFrom = args[1].toInt()
val animationTo = args[2].toInt()
val animationDelay = (args.getOrNull(3) ?: "3").toInt()
var animationId = animationFrom
queueScript(player, 1, QueueStrength.STRONG) {
while (animationId <= animationTo && !HumanoidAnimationIds.contains(animationId)) {
animationId++
}
if (animationId > animationTo) {
return@queueScript stopExecuting(player)
}
animate(player, animationId, true)
notify(player, "Playing player animation $animationId")
animationId++
return@queueScript delayScript(player, animationDelay)
}
}
/**
* Force the player to loop animation <Animation ID>
*/

File diff suppressed because it is too large Load diff