Files
apollo/game/plugin/cmd/src/animate-cmd.plugin.kts
T
2018-04-08 05:15:48 +01:00

15 lines
466 B
Kotlin

import org.apollo.game.model.Animation
import org.apollo.game.model.entity.setting.PrivilegeLevel
on_command("animate", PrivilegeLevel.MODERATOR)
.then { player ->
arguments.firstOrNull()
?.let(String::toIntOrNull)
?.let(::Animation)
?.let {
player.playAnimation(it)
return@then
}
player.sendMessage("Invalid syntax - ::animate [animation-id]")
}