Correct typo in ::objectinfo and print width and height, format command.rb.

This commit is contained in:
Major-
2014-09-11 21:24:40 +01:00
parent 238e6236a7
commit 57dc6c7c9c
2 changed files with 12 additions and 1 deletions
+2 -1
View File
@@ -55,9 +55,10 @@ end
# Sends the user a message with information about the object with the specified id.
on :command, :objectinfo, RIGHTS_ADMIN do |player, command|
args = command.arguments
next unless valid_arg_length(args, 1, player, 'Invalid syntax - ::objectinfo [npc id]')
next unless valid_arg_length(args, 1, player, 'Invalid syntax - ::objectinfo [object id]')
id = args[0].to_i
definition = ObjectDefinition.lookup(id)
player.send_message("Object #{id} is called #{definition.name} and its description is \"#{definition.description}\".")
player.send_message("Its width is #{definition.width} and its height is #{definition.height}.")
end
+10
View File
@@ -14,4 +14,14 @@ class Hash
keys.each { |key| return false unless has_key?(key) }
return true
end
end
class Player
# Returns whether or not the player's
def has_level(skill, level)
return skill_set.get_skill(skill).current_level >= level
end
end