diff --git a/python/CFBank.py b/python/CFBank.py index 2dc0f5cbc..94d1dd2ad 100644 --- a/python/CFBank.py +++ b/python/CFBank.py @@ -26,11 +26,10 @@ import shelve import CFgetPaths class CFBank: - - bankdb_file = '%scrossfirebank' % (CFgetPaths.getPaths('localdir')) bankdb = {} - def __init__(self): + def __init__(self, bankfile): + self.bankdb_file = '%s%s' % (CFgetPaths.getPaths('localdir'),bankfile) self.bankdb = shelve.open(self.bankdb_file) def deposit(self, user, amount): diff --git a/python/IPO/README b/python/IPO/README new file mode 100755 index 000000000..9d1e58ba8 --- /dev/null +++ b/python/IPO/README @@ -0,0 +1,51 @@ +Mail and Messageboard Python scripts for Crossfire +Joris Bontje + +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="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. diff --git a/python/IPO/banksay.py b/python/IPO/banksay.py index 4c7be8152..2f2838640 100644 --- a/python/IPO/banksay.py +++ b/python/IPO/banksay.py @@ -40,10 +40,10 @@ y=CFPython.GetYPosition(activator) #EASILY SETTABLE PARAMETERS service_charge=5 #service charges for transactions as a percent exchange_rate=10000 #exchange rate for silver (value 1) - +bankdatabase="ImperialBank_DB" fees=(service_charge/100)+1 -bank = CFBank.CFBank() +bank = CFBank.CFBank(bankdatabase) text = string.split(CFPython.WhatIsMessage()) thanks_message = ['Thank you for banking the Imperial Way.', 'Thank you, please come again.',\ @@ -108,4 +108,4 @@ elif text[0] == 'balance': else: message = 'Do you need help?' -CFPython.Say(whoami, message) \ No newline at end of file +CFPython.Say(whoami, message) diff --git a/python/python_remove.py b/python/python_remove.py index b6c775b08..b02c6e5e4 100644 --- a/python/python_remove.py +++ b/python/python_remove.py @@ -32,5 +32,7 @@ name = CFPython.GetName(activator) log = CFLog.CFLog() 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)