Re: [QUESTION] Spec Procs with an Affection

From: Mark A. Heilpern (heilpern@MINDSPRING.COM)
Date: 12/08/97


At 05:43 AM 12/7/97 -0500, you wrote:
>        Greetings.
>        I am interested in adding in spec_procs, that when an item is
>worn, it sets an affection on the player. I was looking back at the Ring
>of Invis item that was posted a while back for some ideas, but that uses
>the command 'appear' and 'disappear'.
>        With the ring, if you disappeared, and removed the ring, you were
>still invis, unless 'magical' was the only alias for the ring, then typing
>remove magical would remove the invis affection, and the ring.
>        Would I have to make an alias for the item that is not used
>anywhere else, that way it doesn't get confused? Or could I use a vnum to
>make sure it is the correct item?
>        If anyone knows how to do this using the items vnum and not the
>alias, please let me know. Appreciated.

Well, you could verify the correct object (once you've located it from the
alias used in the command) by vnum I suppose, but that makes for extra work
if you wish to assign the proc to a second object.

Instead, try something like this:

SPECIAL(procname)
{
  struct obj_data *obj;

  /* use your code to locate the obj */

  /* make sure the object located uses THIS function as its specproc */
  if (obj_index[obj->item_number].func != procname) {
    /* this object does not use this function as a specproc */
  } else {
    /* found the object and it's ours! */
  }

I've used this for a "handgrenade" and it works.
Sammy -- equoria.com:4000


     +------------------------------------------------------------+
     | 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/08/00 PST