So, I was coming up with a banking system since my mod is full PvP and I have thief character dynamics planned -
I figured I was going to do a room vault thing for every area where you can find a banker-sort of npc.
I have it planned like this:
1a) crash insurance: there are vault keys for every vault. Using on module load, I set a variable (named after the prefix of all vault keys) to “on” basically, when characters enter, it checks this variable as a prefix for any item tags and deletes any items with the key prefix. When they talk to a banker and want to deposit items, this turns the variable to “off” for them, using their PC persistent variable token.
1b) If a character bought slots but didnt use the key before a server reset/crash - the banker will reimburse lost keys.
- There are two bank factions, the good-aligned Atlanteans and the money-aligned Merchant League who stole the idea from the Atlanteans at one point. So, characters who have good faction with Atlantis or who arent labeled as criminals to Atlantis can bank up to 10 items for 50 gp each, or 20 gp each for Atlantean citizens. The character pays the banker in a conversation. The Merchant League will allow anyone to bank with them but criminals for 100 gp per item, 10 max. The chests are interdimensional, so there is a sum total of 20 possible slots to bank and you can get these items wherever a vault of the appropriate faction exists.
3a) After stating how many items they wish to store indefinitely, the character gets a local vault key, the suffix of the key indicating the nearby door lock’s needs for key tags when combined with the prefix. I already have a universal door script and a companion trigger script that closes/locks doors and strips keys. So, the character opens the vault door, goes down a hall, the door closes and locks behind them and the key poofs. There is a portal behind the chest they use to leave.
3b) Only one Atlantean Vault Key and one Merchant League vault key can exist at any time. The bankers will not give out keys if one is still in use (exploiting this for mischief will be lead to bans).
The chest, when closed uses the number of items the character paid to store (kept on their persistent token) to get the resref of every stored item and stores those on the PC token. It also destroys every item put in the chest. When opened, it checks the token of the PC opening it and if they have a list of banked items, then creates those items in the chest inventory. So, one character can put items in, leave, another enters - they take different items out. I might also be able to use this for players who rent a vendor hireling to sell items in their item vault.
They can bank as much gold as they want at the banker (stored on their token). They can take out loans if they give the lender a valuable item as collateral, equal to twice the value of the item. They cannot take out another loan until they pay back the initial loan. PCs with good faction can have two loans going on. PCs who have been tagged as criminals cannot get loans or bank items.
(This last bit has synergy with my respawn system - as I use Axe Murderer’s Killer Death System and have it configured that you can choose either gold loss or xp loss - so if they always have gold banked, they can only choose xp loss.)
So, to return to the original question referenced in the title of this post:
if a character places gold mistakenly in the chest, will this cause issues? Should I put something blocking item stacks being placed in the chest in order to prevent character placing their gold in the chest? For that matter, will the chest have an issue reproducing stacks of items placed inside? I havent had the time yet to look up every function I will need for the script.
I’m not sure where to look for a function that will limit the number of items one can place in a container. Should I do a looping count of each? Once the loop reaches its limit, what is the best way to implement stopping further storage? A float text, and placing it back in their inventory via destroy object/create object on?