Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CF: merging items

Preston F. Crow () wrote:
> I would find it nicer if more items could be merged, like rings and
> even artifacts.

-:) That's what I thought, too --- I've added it on my server (and the
people using it like it, too). It is a little complicated, though ---
you have to change CAN_MERGE to check all the properties that an
object can have, and you have to add some special handling to the
merge() function (don't know the name):
if an object has nrof==0, and it is a type that you would like to be
merged, set nrof to 1.
Also, you need to change some other pieces of the code:
a) reading spellbooks: the spellbook is destroyed, instead of the number
   being reduced by one, causing "5 spellbooks of xxx" to vanish if you
   read it. This is easy to change.
b) the weapon builder sucks: if you enchant "5 foo", you'll end up
   with "1 bar's foo" and no foos. This is a little more complicated:
   you have to split the item before calling the weapon builder,
   and add the remaining items back in after the weapon builder has
   been called.

>  However, I also like the fact that many items
> don't put a quantity indicator (i.e., 'a') in front of the item,
> especially with rare artifacts.  The solution, as I see it is to
> allow the items to merge, but don't print the number of items
> unless there are more than one.

Good idea. I always wanted to do that, too -:(

Mail me if you need some patches --- however, there are more patches
in the set, so you'll have to figure out the pieces that deal with the
item merging. Also, be aware that this is experimental; I added the
stuff because I (and the players on my server) considered it useful;
there may be bugs (in the first attempt I used a different method to
merge the items, which caused "random artifacts" to be generated randomly -:)
Also, rings suddenly collapsed into the same type, spellbooks vanished,
weapons would get improved automagically etc... I've fixed these things,
but there may be more...

[to unsubscribe etc., send mail to ]