mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-04 08:39:27 +00:00
Add support for edited clients; Properly support chat filtering; Fix issue #11; Make certain Mining messages filterable.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
require 'java'
|
||||
|
||||
java_import 'org.apollo.game.event.impl.ForwardPrivateMessageEvent'
|
||||
java_import 'org.apollo.game.model.World'
|
||||
java_import 'org.apollo.game.model.settings.PrivacyState'
|
||||
|
||||
on :command, :filter do |player, command|
|
||||
player.send_message('Your message filter is now ' + (player.toggle_message_filter ? 'enabled.' : 'disabled.'))
|
||||
end
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0"?>
|
||||
<plugin>
|
||||
<id>message-filter</id>
|
||||
<version>1</version>
|
||||
<name>Message Filter</name>
|
||||
<description>Adds support for a server-side message filter, for clients that have not been edited.</description>
|
||||
<authors>
|
||||
<author>Major</author>
|
||||
</authors>
|
||||
<scripts>
|
||||
<script>filter.rb</script>
|
||||
</scripts>
|
||||
<dependencies />
|
||||
</plugin>
|
||||
@@ -38,7 +38,7 @@ class MiningAction < DistancedAction
|
||||
# the ore
|
||||
def start_mine(pickaxe)
|
||||
@started = true
|
||||
mob.send_message "You swing your pick at the rock."
|
||||
mob.send_message("You swing your pick at the rock.", true)
|
||||
mob.turn_to @position
|
||||
mob.play_animation pickaxe.animation
|
||||
@counter = pickaxe.pulses
|
||||
@@ -51,14 +51,14 @@ class MiningAction < DistancedAction
|
||||
|
||||
# verify the mob can mine with their pickaxe
|
||||
if not (pickaxe != nil and level >= pickaxe.level)
|
||||
mob.send_message "You do not have a pickaxe for which you have the level to use."
|
||||
mob.send_message('You do not have a pickaxe for which you have the level to use.')
|
||||
stop
|
||||
return
|
||||
end
|
||||
|
||||
# verify the mob can mine the ore
|
||||
if ore.level > level
|
||||
mob.send_message "You do not have the required level to mine this rock."
|
||||
mob.send_message('You do not have the required level to mine this rock.')
|
||||
stop
|
||||
return
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user