Re: Keyword for classes/races or class search

From: Skylar (
Date: 06/09/96

On Fri, 7 Jun 1996, Rob Stewart wrote:

> 	I've been trying to find a way to make it possible for a player 
> to type "look target", target being the players race or class.  At first 
> I thought it'd be possible to make each player have a keyword, but I 
> dismissed that idea.  I figure I can do it if I can make a 
> FIND_CLASS_ROOM function and write another command in look_at_target.  
> Does anyone have a FIND_CLASS_ROOM type procedure I could use, or a way I 
> can give players keywords?

Well, just make macros to return the race and class names of the char.
You've probably already got the names in some constant somewhere for
internal use.  Something like...

const char *race_names[] = {

And the macro...

#define RACE_NAME(ch)  (race_names[(int)GET_RACE(ch)])

Modify these functions in handler.c 


Where it makes the first check for isname(tmp, i-> you can just
add your own checks as well...

   || isname(tmp, RACE_NAMES(i)) || isname(tmp, CLASS_NAMES(i)))

You get the idea?

You might want to add a !IS_NPC() check in there, I'm not sure if your
mobs have races or just the players?

Anyways, hope this helps ya...


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