Re: whoops (fwd)

From: Jeff (jfink@csugrad.cs.vt.edu)
Date: 06/01/94


Eric Pilcher <rasta@CSOS.ORST.EDU> writes:
> 
> SPECIAL(thief)
> {
>    struct char_data *cons;
> 
>    if (cmd)
>       return FALSE;
> 
>    if (GET_POS(ch) != POSITION_STANDING)
>       return FALSE;
> 
>    for (cons = world[ch->in_room].people; cons; cons = cons->next_in_room )
>       if ((!IS_NPC(cons)) && (GET_LEVEL(cons) < 21) && (number(1, 5) == 1))
> 	 npc_steal(ch, cons);
> 
>    return TRUE;
> }

I posted this bugfix before, the solution is to modify the last few lines
of this function to look like this:

   for (cons = world[ch->in_room].people; cons; cons = cons->next_in_room )
      if ((!IS_NPC(cons)) && (GET_LEVEL(cons) < LEVEL_IMMORT) &&
	 (number(1, 5) == 1)) {
	 npc_steal(ch, cons);
         return TRUE;
      }

   return FALSE;


> 
> Question 1:  Instead of a raw integer value in there, would it be better
> to have something such as:  (GET_LEVEL(cons) < LEVEL_GOD)

Correct... but you probably want LEVEL_IMMORT in case some immortals
get some powerful weapons you don't want on PCs.

> Question 2:  In other places I see LEVEL_IMM or something to that effect.
> LEVEL_IMM seems to be the same as LEVEL_GOD...  (okay, that's not really
> a question, just an observation).

The default LEVEL_GOD is 32, LEVEL_IMMORT is 31.

> Question 3:  Mobiles with the thief proc do not wander.  Does anyone have a
> fix for this?  I believe there needs to be an else in there somewhere
> so that the thief knows to relax if not stealing.  *shrug*

The fix I posted above solves this.  The problem was that the steal
function always returned TRUE.

-Jeff



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