mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-28 05:45:10 -06:00
::panims
This commit is contained in:
parent
1e5ada15af
commit
da751eb674
2 changed files with 4244 additions and 0 deletions
|
|
@ -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>
|
||||
*/
|
||||
|
|
|
|||
4214
Server/src/main/core/game/system/config/HumanoidAnimationIds.kt
Normal file
4214
Server/src/main/core/game/system/config/HumanoidAnimationIds.kt
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue