mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 08:39:11 +00:00
Add npcinfo command.
This commit is contained in:
@@ -42,4 +42,19 @@ on :command, :iteminfo, RIGHTS_ADMIN do |player, command|
|
||||
members = definition.is_members_only ? "members" : "not members"
|
||||
player.send_message("Item #{id} is called #{definition.name}, is #{members} only, and has a team of #{definition.team}.")
|
||||
player.send_message("Its description is \"#{definition.description}\".")
|
||||
end
|
||||
|
||||
on :command, :npcinfo, RIGHTS_ADMIN do |player, command|
|
||||
args = command.arguments
|
||||
unless args.length == 1
|
||||
player.send_message("Invalid syntax - ::npcinfo [npc id]")
|
||||
return
|
||||
end
|
||||
|
||||
id = args[0].to_i
|
||||
definition = NpcDefinition.lookup(id)
|
||||
|
||||
is_combative = definition.has_combat_level ? "has a combat level of #{definition.combat_level}" : "does not have a combat level"
|
||||
player.send_message("Npc #{id} is called #{definition.name} and #{is_combative}.")
|
||||
player.send_message("Its description is \"#{definition.description}\".")
|
||||
end
|
||||
@@ -43,7 +43,7 @@ public final class NpcDefinition {
|
||||
for (int id = 0; id < definitions.length; id++) {
|
||||
NpcDefinition def = definitions[id];
|
||||
if (def.getId() != id) {
|
||||
throw new RuntimeException("NPC definition id mismatch");
|
||||
throw new RuntimeException("npc definition id mismatch");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user