Well, This is my latest project. I would like to write script that handles EQ gracefully. The script should be able to accomodate multiple EQ sets, and the storage of EQ.
Ages of Despair works on a system where equipment must be stored in secure places, or it will be destroyed at the end of the mud day (reboot).
One method of storage is to rent a 'locker' for 500 coins a day, which can store 10 items (by dropping them on the floor in the locker). I am beyond the need for using a locker.
The other, more preferable method, is to use one or more 'chests' in a house. These are very expensive. 500k to buy a house, and 250k to buy a chest. Once bought, you don't have to pay rental fees. This is the mothod advanced players (including myself) use.
I have actually advanced to the point where i have two seperate rooms in my house for 'everyday' EQ. One room is dedicated to SOLO EQ, and the other is dedicated to PARTY EQ. (There are advantages to wearing different items according to your role).
My initial idea was to create an "EQ_TYPE" variable. This would store the name of the current EQ set being used. The "EQ_TYPE" can be changed via alias, or via trigger. (I plan on making triggers so when I enter my solo room, it automatically sets "EQ_TYPE" to "Solo", and similar for "Party".
The script would keep an array, or series of variables for "Current_EQ". These are the variables that would be used when interactions are made in the MUD, such as wearing or removing the EQ, Poisoning the weapon in your hand, etc. (All via standard aliases). For example:
alias pw
send unwield @Current_EQ_lhand
send smear @Current_EQ_lhand
send wield @Current_EQ_lhand in left hand
When the EQ_TYPE is changed via alias or trigger, the new type is 'loaded' into "Current_EQ".
If you would like to change an item in one of the sets. You would 'load' that set, then use an alias to declare that value. For example:
eqset cloak cloak of rahls
- would set "@Current_EQ_Cloak" to "cloak of rahls"
Whenever an item is declared like this, the modified "Current_EQ" would be 'saved' as the new values for the current "EQ_TYPE".
All of this seems straight-forward enough for me to code. I think i would prefer to actually 'load' and 'save' EQ sets to a file, to save on memory usage. That will be something I need to learn by using advice elsewhere on these boards.
Now, here is where a wrench gets thrown into the works:
It's pretty much a requirement that I also include the item's storage location as part of the Eq_Set. What I end up with, is a record like this:
ItemType ..... ItemName ..... Storage Location
-------- ..... -------- ..... ----------------
head ......... helmet ....... bluechest
feet ......... boots ........ bluechest
lhand ........ dagger ....... redchest
extra 1 ...... poison ....... blackchest
extra 2 ...... poison ....... blackchest
With that information, I can construct GetAll and DropAll aliases that will work no matter which EQ_Set is in use. (Provided the player is in the correct 'room'). It would also make it possible for players to have their solo and party eq in the same chests, though they would probably have to manually change EQ_TYPE via alias.
I would prefer to not "open chest, get item from chest, close chest" for each individual item. It's not very efficient. It would make more sense to "open chest, get this from chest, get that from chest, close chest, open chest2, get this from chest, get that from chest, close chest2". In other words, open one chest, get all from that chest that is required, then close that chest, and repeat on another chest as required.
Of course, that could be done with scripting, but it would require some rather complex coding, so before I get started I am brainstorming to see if, perhaps, there might be a better way to accomplish this grand task. |