mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-04 16:49:11 +00:00
Update existing plugins to use the new utils plugin.
This commit is contained in:
@@ -10,12 +10,12 @@ blacklist = []
|
||||
# Spawns a non-blacklisted npc in the specified position, or the player's position if both 'x' and 'y' are not supplied.
|
||||
on :command, :spawn, RIGHTS_ADMIN do |player, command|
|
||||
args = command.arguments
|
||||
unless [1, 3].include? args.length and (id = args[0].to_i) > -1
|
||||
unless [1, 3].include?(args.length) and (id = args[0].to_i) > -1
|
||||
player.send_message('Invalid syntax - ::spawn [npc id] [optional-x] [optional-y]')
|
||||
return
|
||||
end
|
||||
|
||||
if blacklist.include? id
|
||||
if blacklist.include?(id)
|
||||
player.send_message("Sorry, npc #{id} is blacklisted!")
|
||||
return
|
||||
end
|
||||
@@ -28,12 +28,12 @@ end
|
||||
# Mass spawns npcs around the player.
|
||||
on :command, :mass, RIGHTS_ADMIN do |player, command|
|
||||
args = command.arguments
|
||||
unless args.length == 2 and (id = args[0].to_i) > -1 and (1..5).include? (range = args[1].to_i)
|
||||
unless args.length == 2 and (id = args[0].to_i) > -1 and (1..5).include?(range = args[1].to_i)
|
||||
player.send_message('Invalid syntax - ::spawn [npc id] [range (1-5)]')
|
||||
return
|
||||
end
|
||||
|
||||
if blacklist.include? id
|
||||
if blacklist.include?(id)
|
||||
player.send_message("Sorry, npc #{id} is blacklisted!")
|
||||
return
|
||||
end
|
||||
@@ -56,9 +56,6 @@ end
|
||||
|
||||
# Unregisters all npcs from the world npc repository.
|
||||
on :command, :clearnpcs, RIGHTS_ADMIN do |player, command|
|
||||
iterator = $world.npc_repository.iterator
|
||||
while iterator.has_next
|
||||
$world.unregister(iterator.next)
|
||||
end
|
||||
$world.npc_repository.each { |npc| $world.unregister(npc) }
|
||||
player.send_message('Unregistered all npcs from the world.')
|
||||
end
|
||||
Reference in New Issue
Block a user