Re: [SPELL] Question about objects & owners.

From: Andrew Jones (andjones@MCI2000.COM)
Date: 08/20/98

On the first mud I played, long long ago, there were items and such that
were "owned" by some one.  In the event that someelse got hold of the object
it was zapped out of their hands, and they were told that the object wasn't
their's, I have not implemented this yet.  However this is simple enough,
you create a new modifer for all objects that is a owner field, that would
contain the idnum of the owner(that is not only visible to gods) and also a
new flag that is ITEM_PERSONAL(or whatever floats your boat.)  Then in the
appropriate routines you check for that flag, and if it exits check what the
idnum is, and compare it with the holders idnum.  If they match then do
nothing, if they don't match then send a message to the holders, and force
it out of their hands(or you could force it to vanish into infinity with
some hokey message saying that it has gone searching for it's master...)
Then to set it you could create a few things, for instance if you wanted
certain quest items or high level items, within the do_get routine you could
add a check to see if the object has that flag(ITEM_PERSONAL) and if it
does, and if the idnum field is set to -1, then set the idnum field to that
of the ch who is picking it up.  Enjoy.

>   I made a clone spell, that clones a piece of EQ or a weapon, and then
> fires off an event, and after so many minutes, it extracts the object.
> Everything works fine, but I am curious how to resolve a few things. If
> someone were to give the object to another player, how would I switch the
> ch pointer to the new owner? I need to do this because as the item fades,
> it gives messages to the caster. If the caster gives it away and quits,
> MUD will probably crash (I have not tested this because I assume thats
> what will happen). Is there a way to check to make sure the person that is
> either wielding it or in its inventory is the same as the ch pointer in
> the event structure?

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST