mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-06 08:40:03 +00:00
Add cmd-animate plugin.
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
require 'java'
|
||||||
|
|
||||||
|
java_import 'org.apollo.game.model.Animation'
|
||||||
|
java_import 'org.apollo.game.model.Graphic'
|
||||||
|
|
||||||
|
on :command, :animate, RIGHTS_MOD do |player, command|
|
||||||
|
args = command.arguments
|
||||||
|
unless args.length == 1
|
||||||
|
player.send_message('Invalid syntax - ::animate [animation-id]')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
player.play_animation(Animation.new(args[0].to_i))
|
||||||
|
end
|
||||||
|
|
||||||
|
on :command, :graphic, RIGHTS_MOD do |player, command|
|
||||||
|
args = command.arguments
|
||||||
|
unless args.length == 1
|
||||||
|
player.send_message('Invalid syntax - ::graphic [graphic-id]')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
player.play_graphic(Graphic.new(args[0].to_i))
|
||||||
|
end
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<plugin>
|
||||||
|
<id>cmd-animate</id>
|
||||||
|
<version>1</version>
|
||||||
|
<name>Animate Commands</name>
|
||||||
|
<description>Adds animation-related commands.</description>
|
||||||
|
<authors>
|
||||||
|
<author>Major</author>
|
||||||
|
</authors>
|
||||||
|
<scripts>
|
||||||
|
<script>animate.rb</script>
|
||||||
|
</scripts>
|
||||||
|
<dependencies />
|
||||||
|
</plugin>
|
||||||
Reference in New Issue
Block a user