@@ -3,64 +3,65 @@ import org.apollo.cache.def.ItemDefinition
33import org.apollo.cache.def.NpcDefinition
44import org.apollo.cache.def.ObjectDefinition
55import org.apollo.game.model.entity.setting.PrivilegeLevel
6+ import org.apollo.game.plugin.util.command.valid_arg_length
67
78on_command(" iteminfo" , PrivilegeLevel .ADMINISTRATOR )
8- .then { player ->
9- val invalidSyntax = " Invalid syntax - ::npcinfo [npc id]"
10- if (! valid_arg_length(arguments, 1 , player, invalidSyntax)) {
11- return @then
12- }
9+ .then { player ->
10+ val invalidSyntax = " Invalid syntax - ::npcinfo [npc id]"
11+ if (! valid_arg_length(arguments, 1 , player, invalidSyntax)) {
12+ return @then
13+ }
1314
14- val id = Ints .tryParse(arguments[0 ])
15- if (id == null ) {
16- player.sendMessage(invalidSyntax)
17- return @then
18- }
15+ val id = Ints .tryParse(arguments[0 ])
16+ if (id == null ) {
17+ player.sendMessage(invalidSyntax)
18+ return @then
19+ }
1920
20- val definition = ItemDefinition .lookup(id)
21- val members = if (definition.isMembersOnly) " members" else " not members"
21+ val definition = ItemDefinition .lookup(id)
22+ val members = if (definition.isMembersOnly) " members" else " not members"
2223
23- player.sendMessage(" Item $id is called ${definition.name} , is $members only, and has a " +
24- " team of ${definition.team} ." )
25- player.sendMessage(" Its description is \" ${definition.description} \" ." )
26- }
24+ player.sendMessage(" Item $id is called ${definition.name} , is $members only, and has a " +
25+ " team of ${definition.team} ." )
26+ player.sendMessage(" Its description is \" ${definition.description} \" ." )
27+ }
2728
2829on_command(" npcinfo" , PrivilegeLevel .ADMINISTRATOR )
29- .then { player ->
30- val invalidSyntax = " Invalid syntax - ::npcinfo [npc id]"
31- if (! valid_arg_length(arguments, 1 , player, invalidSyntax)) {
32- return @then
33- }
30+ .then { player ->
31+ val invalidSyntax = " Invalid syntax - ::npcinfo [npc id]"
32+ if (! valid_arg_length(arguments, 1 , player, invalidSyntax)) {
33+ return @then
34+ }
3435
35- val id = Ints .tryParse(arguments[0 ])
36- if (id == null ) {
37- player.sendMessage(invalidSyntax)
38- return @then
39- }
36+ val id = Ints .tryParse(arguments[0 ])
37+ if (id == null ) {
38+ player.sendMessage(invalidSyntax)
39+ return @then
40+ }
4041
41- val definition = NpcDefinition .lookup(id)
42- val isCombative = if (definition.hasCombatLevel()) " has a combat level of ${definition.combatLevel} " else
43- " does not have a combat level"
42+ val definition = NpcDefinition .lookup(id)
43+ val isCombative = if (definition.hasCombatLevel()) " has a combat level of ${definition.combatLevel} " else
44+ " does not have a combat level"
4445
45- player.sendMessage(" Npc $id is called ${definition.name} and $isCombative ." )
46- player.sendMessage(" Its description is \" ${definition.description} \" ." )
47- }
46+ player.sendMessage(" Npc $id is called ${definition.name} and $isCombative ." )
47+ player.sendMessage(" Its description is \" ${definition.description} \" ." )
48+ }
4849
4950on_command(" objectinfo" , PrivilegeLevel .ADMINISTRATOR )
50- .then { player ->
51- val invalidSyntax = " Invalid syntax - ::objectinfo [object id]"
52- if (! valid_arg_length(arguments, 1 , player, invalidSyntax)) {
53- return @then
54- }
51+ .then { player ->
52+ val invalidSyntax = " Invalid syntax - ::objectinfo [object id]"
53+ if (! valid_arg_length(arguments, 1 , player, invalidSyntax)) {
54+ return @then
55+ }
5556
56- val id = Ints .tryParse(arguments[0 ])
57- if (id == null ) {
58- player.sendMessage(invalidSyntax)
59- return @then
60- }
57+ val id = Ints .tryParse(arguments[0 ])
58+ if (id == null ) {
59+ player.sendMessage(invalidSyntax)
60+ return @then
61+ }
6162
62- val definition = ObjectDefinition .lookup(id)
63- player.sendMessage(" Object $id is called ${definition.name} and its description is " +
64- " \" ${definition.description} \" ." )
65- player.sendMessage(" Its width is ${definition.width} and its length is ${definition.length} ." )
66- }
63+ val definition = ObjectDefinition .lookup(id)
64+ player.sendMessage(" Object $id is called ${definition.name} and its description is " +
65+ " \" ${definition.description} \" ." )
66+ player.sendMessage(" Its width is ${definition.width} and its length is ${definition.length} ." )
67+ }
0 commit comments