Files
apollo/data/plugins/bank/bank.rb
T
Dane d8e447196a Fix bank using invalid variable.
In executeAction the variable 'character' was being used instead of.
'mob'. Just a simple overlook anybody could've made.
2014-04-07 13:44:06 -04:00

33 lines
793 B
Ruby

require 'java'
java_import 'org.apollo.game.action.DistancedAction'
java_import 'org.apollo.game.model.inter.bank.BankUtils'
BANK_BOOTH_ID = 2213
BANK_BOOTH_SIZE = 1
class BankAction < DistancedAction
attr_reader :position
def initialize(character, position)
super 0, true, character, position, BANK_BOOTH_SIZE
@position = position
end
def executeAction
mob.turn_to @position
BankUtils.open_bank mob
stop
end
def equals(other)
return (get_class == other.get_class and @position == other.position)
end
end
on :event, :object_action do |ctx, player, event|
if event.option == 2 and event.id == BANK_BOOTH_ID
player.startAction BankAction.new(player, event.position)
end
end
# TODO: when we have NPCs/dialogue, also respond to clicking on them