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ISTRY/
LPMUD/MUDLIB/SECURE/
LPMUD/MUDLIB/SECURE/UDP_CMD_/
LPMUD/MUDLIB/SKILLS/
LPMUD/MUDLIB/SKILLS/FIGHTER/
LPMUD/MUDLIB/SKILLS/THIEF/
LPMUD/MUDLIB/USR/
LPMUD/MUDLIB/USR/CREATORS/
LPMUD/MUDLIB/USR/PLAYERS/
          Magic Items

Magic items include anything that grants players extra powers
beyond their normal means. Such include wands, scrolls, magical
swords, magical armour, magical rings, magical belts or even 
potions.

Magical items should be rare at best, and always destruct when sold. 
They should be hard to get, and NEVER sold at shops. They should also 
only have a few uses if they are powerful - wands, staves, rods, potions, 
scrolls, rings, are standard examples. Some magical items can be placed 
on monsters of high level and ability, but only if the monster can also 
use them. 

One thing to note when reading this document is the use of the word
'charges'. Here, it means the total number of usages it is possible to
get out of the item. It will then be nescesary, when you code the item,
to calculate how many 'actual' charges to give the item so it will be
able to produce about 10, 15, or 25 usages.

While scrolls take the usual time to cast spells from, wands, staves, and
rods actually cast them in one heart beat. MACRO commands are still no
good in these cases as the spell still goes off in the room that the player
is standing in. Hence, he cannot run into a room, use the wand, and run out
again, and not get hit. The wand objects still go through the heart beat
attack function of the player himself. The advantage, however, is instead
of casting a fireball in 3 heart beats, it will be set off in 1 heart beat.


     Scrolls.
Scrolls are spells which players can use, which have been scribed 
onto parchment for later use. Usually, only certain spell casting 
classes can make use of scrolls. Fighters and thieves rarely can 
use scrolls, usually the only ones they can use are scrolls of protection. 
A scroll is ONE USE ONLY. Scrolls are coded by the scroll.c object 
which is inherited and has certain variables set. EG:

     inherit "inherit/scroll";

     reset(arg) {
       if(arg) return;
       set_name("scroll");
       set_short("An old sheet of parchment");
       set_long("It has ancient magical runes written on it.\n");
       set_read("They are magical and can only be read with a detect \n"+
               "magic spell or other divination methods.\n");
       set_info("This is a scroll of fireballs. The command word is 'fire'\n");
       set_spells(({ "fire", "fb", }));

       /* the first is the command word, the next is the spell name from
          the bin of mage spells. the wand.c object automatically looks
          in relevant directories for the file where the spell is kept. */

       set_class(({ "mage", })); /* classes that can use scroll */
       set_cast_level(12);       /*  level spell is cast  */
       set_charges(110);
       set_sell_destruct(1);
       set_value(1000);
       set_weight(1);
     }

The amount of charges on a scroll is not important, as it is only a 
one use item. Later, when we discuss other items it will be important.


     Wands.
Wands are magical items only about a foot long, with a command word
to operate it. As in the above example, this command word goes into
the set_info(message) and not into the short or long. 

The setting of the funs are exactly the same as used in scroll.c
The number of charges that is set is similar to if it was a player
with respect to casting the spell. A fireball costs 11 spell points.
If you wanted to use the wand only once, then 1 charge of 11 points
would be set. Wands normally have no more than 10 charges/uses.

       set_max_charges(int amount);


Where as a scroll is a ONE use only item, wands are able to be used
until all their charges have been used. Hence, a Wand of Fire could
be coded. This item, according to the AD&D DM's Manual (c.TSR), can cast
fire balls, burning hands, walls of fire, and more. To accomodate this
the following setting can be used -

     set_spells(({ "fire", "fb", "burn", "bn", "wall", "wof", }));

Here, the 1st, 3rd, 5th, etc elements of this array are the command
words for the wand. The next are the spell file names that correspond
to the player's spell bin. A wand usually casts spells as if it were
a mage with a level of 10. All wands should be able to be recharged.


     Rings of Spell Storing.
Often rings can hold magical energy inside. Usually, this is only
a one or two one off spells. Such magical items can be coded, and
the 'inherit/ring.c' used, to incorporate the functions in clothing
of wearing and removing as well as the magical functions in wand.c
Rings of spell storing hence only have 2, perhaps 3 charges at most.


	
    Other Items.
Rings, or infact any armour can be used to grant a protection of magic
of a certain kind to a player. Hence, a ring of fire resistance, cold
protection, and the like can be coded. Using ring.c use the fun -

	set_protection("fire");

 - to protect the player. When worn, it protects him, and when removed,
dropped, sold, etc, it removes the protection. Weapons can also use this
set_protection fun if the staff.c file is inherited. 

The cost of these items should be typically 1000 coins more expensive than
their armour/weapon equivalents. Make sure, however, that you do this -

	set_info("This is a ring of fire resistance");

 - so detect magic, and other such player things can access the information.

Armour and weapons can also use the spell storing funs as mentioned in
the above section on rings of spell storing. Such items are counted as
'rings of spell storing' for determination of the amount of spells, value,
etc that are set into it. These items should be rare, however, more so than
rings of spell storing. Rings are the prefered usage for coding, and remember
that players can enchant items, as well as place extra spells into them.



     Rods.
A rod is a little bigger than a wand, but not quite as big as a staff.
Its array of powers is also considerably larger. Typically, a rod has
no more than 15 charges, and has a casting level of no more than 20.
Some powerful rods should not be able to be re-charged. When you make a
rod, simply use wand.c and then use set_name("rod").


     Staves.
A good staff is often a mages best friend (other than his familiar *wink*).
By using 'staff.c' the same settings are available as wands accept that it
can also be wielded. Here, the set_wc(int amount) should be used as well
as type, length, and other features of weapons (c.f weapon documentation).

It appears that the bigger the item, the more charges it has. This is true
with a staff, but a staff also has many more spells as its command, more
than a wand or a rod. A staff commands an impressive 25 charges. Some 
features of a staff may not cost any charges at all! Perhaps the light
ability of the staff is totally free. In such cases add_actions will have
to be built into it by you. But keep this in mind, that this is possible.
A staff commands a casting level of no more than 25th level.

As with some rods, many staves are no rechargable. 


     Recharging Items.
To recharge the item through 'SPECIAL' ways, like players spells (and
not places that simulate petrol(gas) stations for magic items) use -

  query_max_charges()
  adj_charges(int amount)


Never adjust the charges above the max charges allowed for the item.

A mage/cleric of atleast the same level as the wands casting level is
needed to charge the item. Players have the same limitation.



     Value and Cost.
Since magical items such as these cannot be bough then there is NO COST
for these items. Value should be set at -
     
     value = (casting level * 100) + number of total charges left

NPCs can recharge these items, but at a cost of 2 times its current value,
which is also subject to charisma checks (like everything else *giggle*)



     Other Notes.
To have a good idea of the type of wands, scrolls, rods, etc, then 
good resource material can be found in AD&D manuals, and other
fantasy role-playing/gaming books.

                              (c)Angel, December 1993.