I have a question about the implementation of this. The function is in, just
not used anywhere... How about this type of setup for using this funtion:
struct mat_components {
int spell_num; // integer index of the spell
int item1; // vnum of 1st component
int item2; // vnum of 2nd component
int item3; // vnum of 3rd component
bool extract; // extract on use
int wear_out; // if not extract, how many pts of dam to do to the obj
bool verbose; // give the wart message (read mag_materials in magic.c :)
};
struct mat_components mag_stuff[] =
{
{ SPELL_FIREBALL, RED_STONE, ASH, -1, TRUE,0,FALSE},
{-1,-1,-1,-1,0,0,0}
};
Keep the mag_stuff[] array in spell_num order when adding items. Have a
function to check this on boot, just to keep from shooting yourself in the foot,
and to count the number of rows for later usage.
When a spell has the MAG_MATERIAL flag, do a binary search to find the correct
row, and then run it. Would do a linear search (correct term) but this list
could REALLY grow if the mud likes many spells that have many components.
This is a VERY limited implementation though. There just needs to be an easy
way to add materials to spells and right now there is only manual spells.
--Angus
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST