From the NannyMUD documentation

LAST CHANGE

2000-12-15

FUNCTION


NAME

        query_npc - determine if living object is an NPC

LOCATION

        /obj/living.c

SYNTAX

        int query_npc()

DESCRIPTION

        A zero value means the object is either a player or does not
        have the 'npc' variable set.  A non-zero value means object is
        an NPC (Non-Player Character, a role-playing term).

NOTE

        This is not always reliable.  A wizard can easily (by design or by
        mistake) create a monster who does not have the npc variable set
        to a true value.  The preferred method of testing if a living is
        a player is to use the external function interactive().  
        interactive(object) will determine whether the object has a player
        behind it typing away at a keyboard, or does not.

EXAMPLE

        int enter_castle(string str) {
           if( this_player()->query_npc() ) {
              write("The guard stops "+this_player()->query_name()+".\n"+
                    "The guard says: No NPC's allowed in here.\n");
              return 1;
           }
           ...
        }

SEE ALSO

        interactive in efun/object_related/interactive

SEE ALSO

        living in efun/object_related/living