mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-07 16:49:12 +00:00
Fix Runecrafting (broken by cf7a742).
This commit is contained in:
@@ -26,7 +26,7 @@ end
|
|||||||
# Intercepts the item on object message.
|
# Intercepts the item on object message.
|
||||||
on :message, :item_on_object do |ctx, player, message|
|
on :message, :item_on_object do |ctx, player, message|
|
||||||
talisman = TALISMANS[message.id]; altar = ENTRANCE_ALTARS[message.object_id]
|
talisman = TALISMANS[message.id]; altar = ENTRANCE_ALTARS[message.object_id]
|
||||||
if (talisman != nil && altar != nil)
|
unless (talisman.nil? || altar.nil?)
|
||||||
player.start_action(TeleportAction.new(player, message.position, 2, altar.entrance_position))
|
player.start_action(TeleportAction.new(player, message.position, 2, altar.entrance_position))
|
||||||
ctx.break_handler_chain
|
ctx.break_handler_chain
|
||||||
end
|
end
|
||||||
@@ -36,6 +36,7 @@ end
|
|||||||
on :message, :object_action do |ctx, player, message|
|
on :message, :object_action do |ctx, player, message|
|
||||||
if (message.option == 1)
|
if (message.option == 1)
|
||||||
object_id = message.id
|
object_id = message.id
|
||||||
|
|
||||||
if (altar = PORTALS[object_id]) != nil # Get the altar associated with this exit portal.
|
if (altar = PORTALS[object_id]) != nil # Get the altar associated with this exit portal.
|
||||||
player.start_action(TeleportAction.new(player, altar.entrance_position, 1, altar.exit_position))
|
player.start_action(TeleportAction.new(player, altar.entrance_position, 1, altar.exit_position))
|
||||||
ctx.break_handler_chain
|
ctx.break_handler_chain
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ require 'java'
|
|||||||
java_import 'org.apollo.game.action.DistancedAction'
|
java_import 'org.apollo.game.action.DistancedAction'
|
||||||
java_import 'org.apollo.game.model.Animation'
|
java_import 'org.apollo.game.model.Animation'
|
||||||
java_import 'org.apollo.game.model.Graphic'
|
java_import 'org.apollo.game.model.Graphic'
|
||||||
|
java_import 'org.apollo.game.model.entity.Skill'
|
||||||
|
|
||||||
RUNECRAFTING_ANIMATION = Animation.new(791)
|
RUNECRAFTING_ANIMATION = Animation.new(791)
|
||||||
RUNECRAFTING_GRAPHIC = Graphic.new(186, 0, 100)
|
RUNECRAFTING_GRAPHIC = Graphic.new(186, 0, 100)
|
||||||
@@ -22,7 +23,7 @@ class RunecraftingAction < DistancedAction
|
|||||||
end
|
end
|
||||||
|
|
||||||
def executeAction
|
def executeAction
|
||||||
runecrafting_level = @player.skill_set.get_skill(RUNECRAFT_SKILL_ID).current_level
|
runecrafting_level = @player.skill_set.get_skill(Skill::RUNECRAFT).current_level
|
||||||
|
|
||||||
if (runecrafting_level < @rune.level)
|
if (runecrafting_level < @rune.level)
|
||||||
@player.send_message("You need a runecrafting level of #{@rune.level} to craft this rune.")
|
@player.send_message("You need a runecrafting level of #{@rune.level} to craft this rune.")
|
||||||
@@ -41,7 +42,7 @@ class RunecraftingAction < DistancedAction
|
|||||||
@player.inventory.add(@rune.id, added)
|
@player.inventory.add(@rune.id, added)
|
||||||
|
|
||||||
@player.send_message("Your craft the rune essence into #{added > 1 ? 'some ' + @rune.name + 's' : 'an ' + @rune.name}.", true)
|
@player.send_message("Your craft the rune essence into #{added > 1 ? 'some ' + @rune.name + 's' : 'an ' + @rune.name}.", true)
|
||||||
@player.skill_set.add_experience(RUNECRAFT_SKILL_ID, removed * @rune.experience)
|
@player.skill_set.add_experience(Skill::RUNECRAFT, removed * @rune.experience)
|
||||||
stop
|
stop
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user