- minor change to allow multiple bank databases
(not advising that happen, but the bank class should be as modular as possible IMHO) and so I did it. Added README from unlinked with changes git-svn-id: svn://svn.code.sf.net/p/crossfire/code/trunk/maps@2357 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
c448a5752e
commit
3f638c3192
|
@ -26,11 +26,10 @@ import shelve
|
||||||
import CFgetPaths
|
import CFgetPaths
|
||||||
|
|
||||||
class CFBank:
|
class CFBank:
|
||||||
|
|
||||||
bankdb_file = '%scrossfirebank' % (CFgetPaths.getPaths('localdir'))
|
|
||||||
bankdb = {}
|
bankdb = {}
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, bankfile):
|
||||||
|
self.bankdb_file = '%s%s' % (CFgetPaths.getPaths('localdir'),bankfile)
|
||||||
self.bankdb = shelve.open(self.bankdb_file)
|
self.bankdb = shelve.open(self.bankdb_file)
|
||||||
|
|
||||||
def deposit(self, user, amount):
|
def deposit(self, user, amount):
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
Mail and Messageboard Python scripts for Crossfire
|
||||||
|
Joris Bontje <jbontje@suespammers.org>
|
||||||
|
|
||||||
|
Updated Sept 2003 by Todd Mitchell
|
||||||
|
|
||||||
|
This collection offers scripts and a map that allow you
|
||||||
|
to send mail to your fellow players and place public
|
||||||
|
messageboards in the game. There is also a banking system.
|
||||||
|
It also allows for NPCs who can report on player login activity (seen.py).
|
||||||
|
(note the bank script has been moved to banksay.py)
|
||||||
|
|
||||||
|
Requirements:
|
||||||
|
- Crossfire (1.4x or higher(version must have system path functions in Python Plugin))
|
||||||
|
- Python (2.0 or higher)
|
||||||
|
- Python Crossfire plugin (latest)
|
||||||
|
|
||||||
|
Installation:
|
||||||
|
Should work by default if python plugin is running
|
||||||
|
|
||||||
|
It is possible to place multiple messageboards in your
|
||||||
|
game, copy the example in the map from /ImperialPost/IPO and
|
||||||
|
change 'event_say_options GENERALBOARD' and give it an
|
||||||
|
unique name.
|
||||||
|
|
||||||
|
Hooking up other NPCs to the seen script is pretty simple.
|
||||||
|
|
||||||
|
There are currently two post offices and two banking outlets, one each
|
||||||
|
in Navar and Scorn. If you add more please follow these guidelines:
|
||||||
|
|
||||||
|
*******Imperial Post**************
|
||||||
|
The mailboxes could be put in different places, there should be a few around out there.
|
||||||
|
|
||||||
|
|
||||||
|
*******Imperial Banking**************
|
||||||
|
These are Imperial bank (actually Scuds Bank) if you want to
|
||||||
|
add some banks to non-imperial cities (?) maybe consider making different
|
||||||
|
scripts to and use a different currency and a new account database
|
||||||
|
so players can have other bank accout (bankdatabase="<your bank>Bank_DB")
|
||||||
|
changing the bank notes is harder since it involves making a new arch, but
|
||||||
|
you should be able to do so with little problems.
|
||||||
|
|
||||||
|
But remember less is more....
|
||||||
|
|
||||||
|
Right now the only place to get imperial script is the bank. I think it is better
|
||||||
|
to keep it this way and not use imperial script as treasure or make converters.
|
||||||
|
Maybe on a rare occasion have imperials as a quest reward, but remember all Python
|
||||||
|
studff should be optional. Do however consider using imperials for python gadgetry
|
||||||
|
(like slot machines or other such optional gizmos), but only in the Imperial lands.
|
||||||
|
|
||||||
|
Make sure you have updated the python_remove.py script to remove accounts when players quit
|
||||||
|
if you have a custom one.
|
|
@ -40,10 +40,10 @@ y=CFPython.GetYPosition(activator)
|
||||||
#EASILY SETTABLE PARAMETERS
|
#EASILY SETTABLE PARAMETERS
|
||||||
service_charge=5 #service charges for transactions as a percent
|
service_charge=5 #service charges for transactions as a percent
|
||||||
exchange_rate=10000 #exchange rate for silver (value 1)
|
exchange_rate=10000 #exchange rate for silver (value 1)
|
||||||
|
bankdatabase="ImperialBank_DB"
|
||||||
|
|
||||||
fees=(service_charge/100)+1
|
fees=(service_charge/100)+1
|
||||||
bank = CFBank.CFBank()
|
bank = CFBank.CFBank(bankdatabase)
|
||||||
|
|
||||||
text = string.split(CFPython.WhatIsMessage())
|
text = string.split(CFPython.WhatIsMessage())
|
||||||
thanks_message = ['Thank you for banking the Imperial Way.', 'Thank you, please come again.',\
|
thanks_message = ['Thank you for banking the Imperial Way.', 'Thank you, please come again.',\
|
||||||
|
|
|
@ -32,5 +32,7 @@ name = CFPython.GetName(activator)
|
||||||
log = CFLog.CFLog()
|
log = CFLog.CFLog()
|
||||||
log.remove(name)
|
log.remove(name)
|
||||||
|
|
||||||
bank = CFBank.CFBank()
|
#If you add a new bank database add an entry here to remove their account
|
||||||
|
#when the player quits
|
||||||
|
bank = CFBank.CFBank(ImperialBank_DB)
|
||||||
bank.remove_account(name)
|
bank.remove_account(name)
|
||||||
|
|
Loading…
Reference in New Issue