Re: [Code] Futher deep-divings into my code...

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


On Tue, 24 Sep 1996, Mikael Askernds wrote:

> I'm back to pester you all with another coding question..
> If I want to make a flag for a mob, making it impossible to steal from
> it, how would i go about doing it?
> #define MOB_NOSTEAL   (1 << 18) in structs.h is basically all i know
> about it... :)

Right, then copy the way the flags are set/read by db.c's mobile_parser
function, and in the do_steal portion of the circlecode make this check:

if (IS_SET(MOB_FLAGS(mobile), MOB_NOSTEAL))
{
  send_to_char("My my! Trying to steal from me is not healthy! DIE!);
  raw_kill(character);		/* OK, this can be obmitted :) */
  return;
}
.....
 Just have the normal circlecode continue here.. I don't remember if the
MOB_FLAGS macro exists, but it's called something like that. check some of
the MOB_NOBLIND stuff for a real life example..

Hope this gives you a few ideas,
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