mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-04 16:49:11 +00:00
Rebase the MessageHandler, MessageHandlerChain and MessageHandlerChainSet
Rebased several other pieces of code
This commit is contained in:
@@ -25,8 +25,8 @@ module HerbloreMethod
|
||||
end
|
||||
end
|
||||
|
||||
# The ItemOnItemMessage handler for all Herblore-related functions.
|
||||
on :message, :item_on_item do |ctx, player, message|
|
||||
# The ItemOnItemMessage listener for all Herblore-related functions.
|
||||
on :message, :item_on_item do |player, message|
|
||||
primary = message.id
|
||||
secondary = message.target_id
|
||||
hash = HERBLORE_ITEM_ON_ITEM[primary]
|
||||
@@ -41,25 +41,25 @@ on :message, :item_on_item do |ctx, player, message|
|
||||
method = hash[secondary]
|
||||
unless method.nil?
|
||||
method.invoke(player, primary, secondary)
|
||||
ctx.break_handler_chain
|
||||
message.terminate
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# The ItemOptionMessage handler for all Herblore-related functions.
|
||||
on :message, :first_item_option do |ctx, player, message|
|
||||
# The ItemOptionMessage listener for all Herblore-related functions.
|
||||
on :message, :first_item_option do |player, message|
|
||||
id = message.id
|
||||
method = HERBLORE_ITEM[id]
|
||||
|
||||
unless method.nil?
|
||||
method.invoke(player, id, message.slot)
|
||||
ctx.break_handler_chain
|
||||
message.terminate
|
||||
end
|
||||
method = DRINK_ITEM[id]
|
||||
|
||||
unless method.nil?
|
||||
method.invoke(player, id, message.slot)
|
||||
ctx.break_handler_chain
|
||||
message.terminate
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ class GrindingAction < Action
|
||||
end
|
||||
end
|
||||
|
||||
# Appends a ground ingredient to the ItemOnItemMessage handler interception.
|
||||
# Appends a ground ingredient to the ItemOnItemMessage listener interception.
|
||||
def append_ground(id, raw)
|
||||
ground = GroundIngredient.new(id, raw)
|
||||
append_herblore_item(ground, PESTLE_MORTAR, raw)
|
||||
|
||||
Reference in New Issue
Block a user