mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-04 08:39:27 +00:00
Add magic plugin, more decoders and commands.
This commit is contained in:
@@ -3,9 +3,10 @@
|
||||
<id>cmd-skill</id>
|
||||
<version>1</version>
|
||||
<name>Skill Commands</name>
|
||||
<description>Adds a ::max command.</description>
|
||||
<description>Adds skill-related commands.</description>
|
||||
<authors>
|
||||
<author>Graham</author>
|
||||
<author>Major</author>
|
||||
</authors>
|
||||
<scripts>
|
||||
<script>skill.rb</script>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
require 'java'
|
||||
java_import 'org.apollo.game.model.SkillSet'
|
||||
java_import 'org.apollo.game.model.Skill'
|
||||
|
||||
on :command, :max, RIGHTS_ADMIN do |player, command|
|
||||
skills = player.skill_set
|
||||
@@ -7,3 +8,40 @@ on :command, :max, RIGHTS_ADMIN do |player, command|
|
||||
skills.add_experience(skill, SkillSet::MAXIMUM_EXP)
|
||||
end
|
||||
end
|
||||
|
||||
on :command, :level, RIGHTS_ADMIN do |player, command|
|
||||
args = command.arguments
|
||||
unless args.length == 2
|
||||
player.send_message("Invalid syntax - ::level [skill id] [level]")
|
||||
return
|
||||
end
|
||||
|
||||
skill = args[0].to_i
|
||||
level = args[1].to_i
|
||||
|
||||
unless (0..20).include? skill and (1..99).include? level
|
||||
player.send_message("Invalid syntax - ::level [skill id] [level]")
|
||||
return
|
||||
end
|
||||
|
||||
experience = SkillSet.experience_for_level(level)
|
||||
player.skill_set.set_skill(skill, Skill.new(experience, level, level))
|
||||
end
|
||||
|
||||
on :command, :xp, RIGHTS_ADMIN do |player, command|
|
||||
args = command.arguments
|
||||
unless args.length == 2
|
||||
player.send_message("Invalid syntax - ::xp [skill id] [experience]")
|
||||
return
|
||||
end
|
||||
|
||||
skill = args[0].to_i
|
||||
experience = args[1].to_i
|
||||
|
||||
unless (0..20).include? skill
|
||||
player.send_message("Invalid syntax - ::xp [skill id] [experience]")
|
||||
return
|
||||
end
|
||||
|
||||
player.skill_set.add_experience(skill, experience)
|
||||
end
|
||||
Reference in New Issue
Block a user