Re: [Circle] [code]Sacrifice command

From: Rasmus 'Con' Ronlev (raro94ab@hp4.econ.cbs.dk)
Date: 11/13/96


On Wed, 13 Nov 1996 grond@grotl.com wrote:

> We are attempting to allow the players to do some house cleaning
> (necessary since we equipped or corpses with disease now), and am trying
> to imp a sacrifice command.
>
> Problem I'm having is having the system identify a corpse as a corpse.
> We've tried to get it with the command:
[SNIP]

Well, quoting some Circlecode (tm:) from fight.c :


  GET_OBJ_TYPE(corpse) = ITEM_CONTAINER;
  GET_OBJ_WEAR(corpse) = ITEM_WEAR_TAKE;
  GET_OBJ_EXTRA(corpse) = ITEM_NODONATE;
  GET_OBJ_VAL(corpse, 0) = 0;   /* You can't store stuff in a corpse */
  GET_OBJ_VAL(corpse, 2) = IS_NPC(ch) ? -1 : GET_IDNUM(ch);
  GET_OBJ_VAL(corpse, 3) = 1;   /* corpse identifier */

This comes from make_corpse().

So, in general if:

if (GET_OBJ_TYPE(obj) == ITEM_CONTAINER && GET_OBJ_VAL(obj, 3) == 1)

then you have a corpse... this needs that obj is a pointer to a 'filled'
struct of the type obj_data, but that should be normal knowledge :)

Hope this is of some use though I think I'm a little late with this reply,
Con

d.
--
     Rasmus Rønlev DOEK'94      WWW: http://www.econ.cbs.dk/people/raro94ab
     Student instructor         MUD: exiled.mud.circlemud.org 5000
                                         199.199.16.100 5000
       Student, B.Sc in Computer Science and Business Administration.

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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