mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 08:39:11 +00:00
Default apollo.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
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
|
||||
character.turn_to @position
|
||||
BankUtils.open_bank character
|
||||
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
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0"?>
|
||||
<plugin>
|
||||
<id>bank</id>
|
||||
<version>1</version>
|
||||
<name>Bank</name>
|
||||
<description>Opens the bank interface when players select 'use-quickly' on a bank booth.</description>
|
||||
<authors>
|
||||
<author>Graham</author>
|
||||
</authors>
|
||||
<scripts>
|
||||
<script>bank.rb</script>
|
||||
</scripts>
|
||||
<dependencies />
|
||||
</plugin>
|
||||
Reference in New Issue
Block a user