Proc:Vault

From SlothMUD Wiki
Jump to: navigation, search

Overview

The vault procedure allows players establish their own customizable rooms and to store items in vaults. Vault rooms are created by Proc:Neighborhood when a player issues a BUILD command.


KVP

The vault proc uses KVP to store some values related to the capabilities of the vault. These KVP values are:

Key Description
CFG_ID Standard proc key - must be set to 1.
PROC_NUM Standard proc key - must be set to 4.
PROC_ENABLED Standard proc key - must be set to 1.
PROC_CAN_READ Standard proc key - set to 44.
PROC_DEBUG Standard proc key. By default this key does not exist but it can be set to 1 to print out a series of debug messages to the room.
ROOM_FLAGS Flags pertaining to the room.

1 = Entry Room

VAULT_COMBINATION Combination to unlock the vault.
VAULT_CAPACITY Number of slots available for storing equipment in the vault. New vaults receive 20 slots. The maximum available for purchase is a total of 40 slots.
MODULE_FLAGS Flag value indicating which upgrade modules have been purchased.

1 = Say Recall
2 = Keyless Entry

KEYLESS_PHRASE Phrase used to enter/exit the vault.
KEYLESS_PERMIT Colon separated list of players allowed to enter the vault using the keyless entry phrase.

A number of keys are used to store custom teleportation messages for the say recall and keyless entry modules:

Key
SAY_RECALL_ACTOR_DEPARTURE_MESSAGE
SAY_RECALL_ROOM_DEPARTURE_MESSAGE
SAY_RECALL_ACTOR_ARRIVAL_MESSAGE
SAY_RECALL_ROOM_ARRIVAL_MESSAGE
KEYLESS_ACTOR_OUTDOOR_DEPARTURE_MESSAGE
KEYLESS_ROOM_OUTDOOR_DEPARTURE_MESSAGE
KEYLESS_ACTOR_INDOOR_ARRIVAL_MESSAGE
KEYLESS_ROOM_INDOOR_ARRIVAL_MESSAGE
KEYLESS_ACTOR_INDOOR_DEPARTURE_MESSAGE
KEYLESS_ROOM_INDOOR_DEPARTURE_MESSAGE
KEYLESS_ACTOR_OUTDOOR_ARRIVAL_MESSAGE
KEYLESS_ROOM_OUTDOOR_ARRIVAL_MESSAGE

Database Tables

RoomOwners

The RoomOwners table contains fields regarding the owner of the room. Currently, owner status is only used for vaults but could be used in other ways in the future.

Field Description
VnumRoom Virtual number of the room.
OwnerTypeId 1 = Player
2 = Clan
OwnerName Name of the player or clan.


VaultItems

The VaultItems table contains the list of items currently stored in the vault.

Field Description
UniqueID Unique identifier for the row of data.
VnumRoom Virtual number of the room containing this item.
SortOrder Value indicating what order the data should be pulled from the table via the ORDER BY clause. This is important for making sure that relationships are maintained between items and their clasps, runes, and/or contents.
Clasps Total number of clasps and runes attached/socketed to this item.
Children Number of items contained inside this item. This does not count nested items.
ItemVnum Virtual number of the item.
ItemValue0 - ItemValue13 Integer values attached to the item. These values mean different things depending on the type of item.
ItemExtraFlag0 - ItemExtraFlag2 The extra flags of the item.
ItemTimer How long before the item crumbles.
ItemBitVector Bit vector of AFF_XXX flags to set on the player when the item is worn.
ItemSerial The semi-unique serial number of the item.
ItemAffect0Location - ItemAffect4Location The type of affect the item has on the player when the item is worn.
ItemAffect0Modifier - ItemAffect4Modifier The amount the affect changes on the player when the item is worn.
ItemName The names or keywords of this item. This value is always saved to the database but is ignored when the item is loaded unless the item has been restrung and contains the ITEM_MODIFIED flag.
ItemDescription The description show when the item is in a room. This value is always saved to the database but is ignored when the item is loaded unless the item has been restrung and contains the ITEM_MODIFIED flag.
ItemShortDescription The description of the item when it is in inventory or a container. This value is always saved to the database but is ignored when the item is loaded unless the item has been restrung and contains the ITEM_MODIFIED flag.
ItemActionDescription The description of the item when it is used. This value is always saved to the database but is ignored when the item is loaded unless the item has been restrung and contains the ITEM_MODIFIED flag.


Upgrading from Old Code

The steps required to upgrade a vault from the old code are:

  1. Have the player empty the vault
  2. UPGRADE! VAULT <player>
  3. UNLOCK VAULT
  4. Have the player put their items back in the vault
  5. Have the player lock vault <new combination>

It may be easier for the immortal to handle emptying the vault and then putting the items back in. If the immortal has an empty inventory at the start, the items can be deposited via DEPOSIT ALL. Also, mortals will be unable to deposit personal items belonging to alt characters.

If the player has purchased a say recall trigger, you will need to:

  1. HOUSE UPGRADE RECALL
  2. Purge the invisible object in the room providing the old trigger.
  3. ZONE DELETE the command creating the invisible trigger object.
  4. SAVEAREA
  5. Go outside the vault and purge the invisible trigger object if it exists.

If the player has purchased keyless entry, you will need to:

  1. HOUSE UPGRADE KEYLESS <keyphrase>
  2. HOUSE PERMIT for each additional player with access to the house.
  3. HOUSE SET <message name> <message> for any custom teleportation messages.
  4. Purge the invisible object in the room providing the old trigger.
  5. ZONE DELETE the command creating the invisible trigger object.
  6. SAVEAREA
  7. Go outside the vault and purge the invisible trigger object if it exists.