act_info.c

muddy/src/act_info.c · 196.5 KB

From the archive astrum.tar.bz2

Download the archive   « Back to the archive contents

/* $Id: act_info.c,v 1.666 2004/09/20 10:49:46 shrike Exp $ */

/************************************************************************************
 *    Copyright 2004 Astrum Metaphora consortium                                    *
 *                                                                                  *
 *    Licensed under the Apache License, Version 2.0 (the "License");               *
 *    you may not use this file except in compliance with the License.              *
 *    You may obtain a copy of the License at                                       *
 *                                                                                  *
 *    http://www.apache.org/licenses/LICENSE-2.0                                    *
 *                                                                                  *
 *    Unless required by applicable law or agreed to in writing, software           *
 *    distributed under the License is distributed on an "AS IS" BASIS,             *
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.      *
 *    See the License for the specific language governing permissions and           *
 *    limitations under the License.                                                *
 *                                                                                  *
 ************************************************************************************/
 /************************************************************************************
 *     ANATOLIA 2.1 is copyright 1996-1997 Serdar BULUT, Ibrahim CANPUNAR           *
 *     ANATOLIA has been brought to you by ANATOLIA consortium                      *
 *       Serdar BULUT {Chronos}         bulut@rorqual.cc.metu.edu.tr                *
 *       Ibrahim Canpunar  {Asena}      canpunar@rorqual.cc.metu.edu.tr             *
 *       Murat BICER  {KIO}             mbicer@rorqual.cc.metu.edu.tr               *
 *       D.Baris ACAR {Powerman}        dbacar@rorqual.cc.metu.edu.tr               *
 *     By using this code, you have agreed to follow the terms of the               *
 *     ANATOLIA license, in the file Anatolia/anatolia.licence                      *
 ***********************************************************************************/

/************************************************************************************
 *  Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer,                 *
 *  Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe.            *
 *                                                                                  *
 *  Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael                   *
 *  Chastain, Michael Quan, and Mitchell Tse.                                       *
 *                                                                                  *
 *  In order to use any part of this Merc Diku Mud, you must comply with            *
 *  both the original Diku license in 'license.doc' as well the Merc                *
 *  license in 'license.txt'.  In particular, you may not remove either of          *
 *  these copyright notices.                                                        *
 *                                                                                  *
 *  Much time and thought has gone into this software and you are                   *
 *  benefitting.  We hope that you share your changes too.  What goes               *
 *  around, comes around.                                                           *
 ************************************************************************************/

/************************************************************************************
*       ROM 2.4 is copyright 1993-1995 Russ Taylor                                  *
*       ROM has been brought to you by the ROM consortium                           *
*           Russ Taylor (rtaylor@pacinfo.com)                                       *
*           Gabrielle Taylor (gtaylor@pacinfo.com)                                  *
*           Brian Moore (rom@rom.efn.org)                                           *
*       By using this code, you have agreed to follow the terms of the              *
*       ROM license, in the file Rom24/doc/rom.license                              *
*************************************************************************************/

/************************************************************************************
 * Copyright (c) 1998 fjoe <fjoe@iclub.nsu.ru>                                      *
 * All rights reserved.                                                             *
 *                                                                                  *
 * Redistribution and use in source and binary forms, with or without               *
 * modification, are permitted provided that the following conditions               *
 * are met:                                                                         *
 * 1. Redistributions of source code must retain the above copyright                *
 *    notice, this list of conditions and the following disclaimer.                 *
 * 2. Redistributions in binary form must reproduce the above copyright             *
 *    notice, this list of conditions and the following disclaimer in the           *
 *    documentation and/or other materials provided with the distribution.          *
 *                                                                                  *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND           *
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE            *
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE       *
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE          *
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL       *
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS          *
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)            *
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT       *
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY        *
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF           *
 * SUCH DAMAGE.                                                                     *
 ************************************************************************************/


#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <stdarg.h>

#if !defined (WIN32)
#include <unistd.h>
#include <sys/time.h>
#endif
#include <ctype.h>

#include "merc.h"
#include "update.h"
#include "quest.h"
#include "obj_prog.h"
#include "fight.h"
#include "db/db.h"
#include "db/lang.h"
#include "riddle.h"
#include "rating.h"
#include "wanderers.h"
#include "conquer.h"
#include "wquest.h"
#include "shamans.h"

#define MAX_SKILL 1024

#if defined(SUNOS) || defined(SVR4)
#include <crypt.h>
#endif

extern STAT_DATA stat_record;

/* command procedures needed */
DECLARE_DO_FUN(do_exits         );
DECLARE_DO_FUN(do_look          );
DECLARE_DO_FUN(do_help          );
DECLARE_DO_FUN(do_affects       );
DECLARE_DO_FUN(do_saffects      );
DECLARE_DO_FUN(do_gaffects      );
DECLARE_DO_FUN(do_murder        );
DECLARE_DO_FUN(do_say           );
DECLARE_DO_FUN(do_alist         );

char *get_stat_alias(CHAR_DATA *ch, int which);
void    bust_a_prompt           (CHAR_DATA *ch);
void look_window( CHAR_DATA *ch, OBJ_DATA *obj );
void look_gate  ( CHAR_DATA *ch, OBJ_DATA *obj );

bool            wizlock;        /* Game is wizlocked        */
bool            newlock;        /* Game is newlocked        */

extern MOB_EXTRA created_golem_extra[];
//TODO: test
static int show_order[] = {
    WEAR_LIGHT,
    WEAR_HEAD,
    WEAR_EAR,
    WEAR_FACE,
    WEAR_NECK_1,
    WEAR_ABOUT,
    WEAR_ARMS,
    WEAR_BODY,
    WEAR_WAIST,
    WEAR_WRIST_L,
    WEAR_WRIST_R,
    WEAR_FINGER_L,
    WEAR_FINGER_R,
    WEAR_HANDS,
    WEAR_WIELD,
    WEAR_SECOND_WIELD,
    WEAR_SHIELD,
    WEAR_HOLD,
    WEAR_LEGS,
    WEAR_FEET,
    WEAR_TAIL,
    WEAR_TATTOO,
    WEAR_CLANMARK,
    WEAR_PLUG_IN,
    WEAR_FLOAT,
    -1
};

typedef struct pskill
{
    char name[22];
    int  prac;
} pskill;

/* for do_count */
int max_on = 0;

/*
 * Local functions.
 */
char *  format_obj_to_char      (OBJ_DATA *obj, CHAR_DATA *ch, bool fShort);
void    show_list_to_char       (OBJ_DATA *list, CHAR_DATA *ch,
                                 bool fShort, bool fShowNothing);
void    show_char_to_char_0     (CHAR_DATA *victim, CHAR_DATA *ch);
void    show_char_to_char_1     (CHAR_DATA *victim, CHAR_DATA *ch);
void    show_char_to_char       (CHAR_DATA *list, CHAR_DATA *ch);
void    show_wanted_desk        (CHAR_DATA *ch);

#define strend(s) (strchr(s, '\0'))

char *format_obj_to_char(OBJ_DATA *obj, CHAR_DATA *ch, bool fShort)
{
    static char buf[MAX_STRING_LENGTH];

    buf[0] = '\0';
    if ((fShort && mlstr_null(obj->short_descr))  || mlstr_null(obj->description))
        return str_empty;

    if (IS_SET(ch->comm, COMM_LONG))
    {
        if (IS_OBJ_STAT(obj, ITEM_INVIS))
            strnzcat(buf, sizeof(buf), GETMSG("({yInvisible{x) ", ch->lang));
        if (IS_OBJ_STAT(obj, ITEM_DARK))
            strnzcat(buf, sizeof(buf), GETMSG("({DDark{x) ", ch->lang));
        if (IS_AFFECTED(ch, AFF_DETECT_EVIL) && IS_OBJ_STAT(obj, ITEM_EVIL))
            strnzcat(buf, sizeof(buf), GETMSG("({RRed Aura{x) ", ch->lang));
        if (IS_AFFECTED(ch, AFF_DETECT_GOOD) && IS_OBJ_STAT(obj, ITEM_BLESS))
            strnzcat(buf, sizeof(buf), GETMSG("({BBlue Aura{x) ", ch->lang));
        if (IS_AFFECTED(ch, AFF_DETECT_MAGIC)  && IS_OBJ_STAT(obj, ITEM_MAGIC))
            strnzcat(buf, sizeof(buf), GETMSG("({MMagic{x) ", ch->lang));
        if (IS_OBJ_STAT(obj, ITEM_GLOW))
            strnzcat(buf, sizeof(buf), GETMSG("({WGlow{x) ", ch->lang));
        if (IS_OBJ_STAT(obj, ITEM_HUM))
            strnzcat(buf, sizeof(buf), GETMSG("({YçÕÄÉÔ{x) ", ch->lang));
    } else
    {
        static char FLAGS[] = "{x[{y.{D.{R.{B.{M.{W.{Y.{x] ";
        strnzcpy(buf, sizeof(buf), FLAGS);
        if (IS_OBJ_STAT(obj, ITEM_INVIS))                                          buf[5]  = 'I';
        if (IS_OBJ_STAT(obj, ITEM_DARK))                                           buf[8]  = 'D';
        if (IS_AFFECTED(ch, AFF_DETECT_EVIL)   && IS_OBJ_STAT(obj, ITEM_EVIL))     buf[11] = 'E';
        if (IS_AFFECTED(ch, AFF_DETECT_GOOD)   && IS_OBJ_STAT(obj,ITEM_BLESS))     buf[14] = 'B';
        if (IS_AFFECTED(ch, AFF_DETECT_MAGIC)  && IS_OBJ_STAT(obj, ITEM_MAGIC))    buf[17] = 'M';
        if (IS_OBJ_STAT(obj, ITEM_GLOW))                                           buf[20] = 'G';
        if (IS_OBJ_STAT(obj, ITEM_HUM))                                            buf[23] = 'H';

    }

// FIXME: ÐÅÒÅÄÅÌÁÔØ ËÁË ÆÌÁÇÉ × ÇÒÉÐÁÈ

    if (!IS_NPC(ch) && IS_SET(ch->comm2, COMM2_VNUM_SHOW))
        if (ch->pcdata->security > 1 || IS_IMMORTAL (ch))
        {
            char buf1[MAX_STRING_LENGTH];
            snprintf(buf1, sizeof(buf1), "[%6d] ", obj->pIndexData->vnum);
            strnzcat(buf, sizeof(buf), buf1);
        }

    if (fShort)
    {
        strnzcat(buf, sizeof(buf), format_short(obj->short_descr, obj->name, ch, 0));

        if (obj->pIndexData->vnum > 5  && (obj->condition < COND_EXCELLENT))
        {
            char buf2[MAX_STRING_LENGTH];
            snprintf(buf2, sizeof(buf2), " [%s]",  GETMSG(get_cond_alias(obj), ch->lang));
            strnzcat(buf, sizeof(buf), buf2);
        }
        return buf;
    }

    if (obj->in_room != NULL && IS_WATER(obj->in_room))
    {
        char* p;

        p = strend(buf);
        strnzcat(buf, sizeof(buf), format_short(obj->short_descr, obj->name, ch, 0));
        p[0] = UPPER(p[0]);
        switch (dice(1,3))
        {
            case 1:
                strnzcat(buf, sizeof(buf), GETMSG(" ÐÌÁ×ÁÅÔ ÎÁ ÐÏ×ÅÒÈÎÏÓÔÉ ×ÏÄÙ.", ch->lang));
                break;
            case 2:
                strnzcat(buf, sizeof(buf), GETMSG(" ÐÌÙ×ÅÔ ÐÏ ×ÏÄÅ.", ch->lang));
                break;
            case 3:
                strnzcat(buf, sizeof(buf), GETMSG(" ÍÏËÎÅÔ × ×ÏÄÅ.", ch->lang));
                break;
        }
    } else
        strnzcat(buf, sizeof(buf), format_descr(obj->description, ch));
    return buf;
}

/*
 * Show a list to a character.
 * Can coalesce duplicated items.
 */
void show_list_to_char(OBJ_DATA *list, CHAR_DATA *ch, bool fShort, bool fShowNothing)
{
    BUFFER       *output;
    const char  **prgpstrShow;
    int          *prgnShow;
    char         *pstrShow;
    OBJ_DATA     *obj;
    int           nShow;
    int           iShow;
    int           count;
    bool          fCombine;

    if (ch->desc == NULL)
        return;

    /*
     * Alloc space for output lines.
     */
    output = buf_new(-1);

    count = 0;
    for (obj = list; obj != NULL; obj = obj->next_content)
        count++;
    prgpstrShow = malloc(count * sizeof(char *));
    prgnShow    = malloc(count * sizeof(int)  );
    nShow   = 0;

    /*
     * Format the list of objects.
     */
    for (obj = list; obj != NULL; obj = obj->next_content)
    {
        if (obj->wear_loc == WEAR_NONE && can_see_obj(ch, obj))
        {
            pstrShow = format_obj_to_char(obj, ch, fShort);

            fCombine = FALSE;

            if (IS_NPC(ch) || IS_SET(ch->comm, COMM_COMBINE))
            {
                /*
                 * Look for duplicates, case sensitive.
                 * Matches tend to be near end so run loop
                 * backwords.
                 */
                for (iShow = nShow - 1; iShow >= 0; iShow--)
                {
                    if (!strcmp(prgpstrShow[iShow], pstrShow))
                    {
                        prgnShow[iShow]++;
                        fCombine = TRUE;
                        break;
                    }
                }
            }

            /*
             * Couldn't combine, or didn't want to.
             */
            if (!fCombine)
            {
                prgpstrShow [nShow] = str_dup(pstrShow);
                prgnShow    [nShow] = 1;
                nShow++;
            }
        }
    }

    /*
     * Output the formatted list.
     */
    for (iShow = 0; iShow < nShow; iShow++)
    {
        if (prgpstrShow[iShow][0] == '\0')
            continue;

        if (IS_NPC(ch) || IS_SET(ch->comm, COMM_COMBINE))
        {
            if (prgnShow[iShow] != 1)
                buf_printf(output, "(%2d) ", prgnShow[iShow]);
            else
                buf_add(output,"     ");
        }

        buf_add(output, prgpstrShow[iShow]);
        buf_add(output,"\n");
        free_string(prgpstrShow[iShow]);
    }

    if (fShowNothing && nShow == 0)
    {
        if (IS_NPC(ch) || IS_SET(ch->comm, COMM_COMBINE))
            char_puts("     ", ch);
        act("îÉÞÅÇÏ.", ch, NULL, NULL, TO_CHAR);
    }

    page_to_char(buf_string(output),ch);

    /*
     * Clean up.
     */
    buf_free(output);
    free(prgpstrShow);
    free(prgnShow);
}

#define FLAG_SET(pos, c, exp) (FLAGS[pos] = (exp) ? (flags = TRUE, c) : '.')

void show_char_to_char_0(CHAR_DATA *victim, CHAR_DATA *ch)
{
    const char *msg = str_empty;
    const void *arg = str_empty;
    const void *arg3 = str_empty;
    flag32_t flags = 0;

    if (is_affected(victim, gsn_doppelganger)  && (IS_NPC(ch) || !IS_SET(ch->plr_flags, PLR_HOLYLIGHT)))
        victim = victim->doppel;

    if (IS_NPC(victim))
    {
        if (IS_IMMORTAL(ch) && IS_SET(ch->comm2, COMM2_VNUM_SHOW))
            act_puts("{D[{w$j{D]{x ", ch, (const void *)victim->pIndexData->vnum, victim, TO_CHAR | ACT_NOLF, POS_DEAD);

        if (!IS_NPC(ch) && ch->pcdata->questmob > 0   && victim->hunter == ch)
            act_puts("{r[{RTARGET{r]{x ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
    } else
    {
        if (IS_SET(victim->plr_flags, PLR_WANTED) && IS_IMMORTAL(ch))
            act_puts("({RWanted{x) ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);

        if (IS_SET(victim->comm, COMM_AFK))
            act_puts("{w[{MAFK{w]{x ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
    }

    if (IS_SET(ch->comm, COMM_LONG))
    {
        if (IS_AFFECTED(victim, AFF_INVIS))
            act_puts("({yîÅ×ÉÄÉÍÏ{x) ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
        if (IS_AFFECTED(victim, AFF_HIDE))
            act_puts("({DóÐÒÑÔÁÎÏ{x) ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
        if (IS_AFFECTED(victim, AFF_CHARM))
            act_puts("({mïÞÁÒÏ×ÁÎÏ{x) ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
        if (IS_AFFECTED(victim, AFF_PASS_DOOR))
            act_puts("({cðÒÏÚÒÁÞÎÏ{x) ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
        if (IS_AFFECTED(victim, AFF_FAERIE_FIRE))
            act_puts("({MòÏÚÏ×ÁÑ áÕÒÁ{x) ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
        if (IS_UNDEAD(victim) && IS_AFFECTED(ch, AFF_DETECT_UNDEAD))
            act_puts("({DUndead{x) ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
        if (RIDDEN(victim))
            act_puts("({GïÓÅÄÌÁÎÏ{x) ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
        if (IS_AFFECTED(victim,AFF_IMP_INVIS))
            act_puts("({bîÅ×ÉÄÉÍÏ{x) ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
        if (IS_EVIL(victim) && IS_AFFECTED(ch, AFF_DETECT_EVIL))
            act_puts("({RëÒÁÓÎÁÑ áÕÒÁ{x) ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
        if (IS_GOOD(victim) && IS_AFFECTED(ch, AFF_DETECT_GOOD))
            act_puts("({YúÏÌÏÔÁÑ áÕÒÁ{x) ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
        if (IS_AFFECTED(victim, AFF_SANCTUARY))
            act_puts("({WâÅÌÁÑ áÕÒÁ{x) ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
        if (IS_AFFECTED(victim, AFF_BLACK_SHROUD))
            act_puts("({DþÅÒÎÁÑ áÕÒÁ{x) ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
        if (IS_AFFECTED(victim, AFF_FADE))
            act_puts("({yòÁÓÐÌÙ×ÞÁÔÏ{x) ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
        if (IS_AFFECTED(victim, AFF_CAMOUFLAGE))
            act_puts("({gúÁÍÁÓËÉÒÏ×ÁÎÏ{x) ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
        if (IS_AFFECTED(victim, AFF_TRAP))
            act_puts("({DúÁÍÁÓËÉÒÏ×ÁÎÏ{x) ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
        if (IS_AFFECTED(victim, AFF_EARTHFADE))
            act_puts("({rúÅÍÌÅÊ õÐÒÑÔÁÎÏ{x) ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
        if (IS_AFFECTED(victim, AFF_PROTECTION))
            act_puts("({cúÁÝÉÝÅÎÏ{x)", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
    } else
    {
        static char FLAGS[] =
        "{x[{y.{D.{m.{c.{M.{D.{G.{b.{R.{Y.{W.{y.{g.{r.{c.{x] ";
        bool flags = FALSE;

        FLAG_SET( 5, 'I', IS_AFFECTED(victim, AFF_INVIS));
        FLAG_SET( 8, 'H', IS_AFFECTED(victim, AFF_HIDE));
        FLAG_SET(11, 'C', IS_AFFECTED(victim, AFF_CHARM));
        FLAG_SET(14, 'T', IS_AFFECTED(victim, AFF_PASS_DOOR));
        if (IS_AFFECTED(victim, AFF_TRAP))
        {
            FLAG_SET(17, 'T', TRUE);
            FLAG_SET(16, 'D', TRUE);
        } else if (IS_AFFECTED(victim, AFF_FAERIE_FIRE))
        {
            FLAG_SET(17, 'P', TRUE);
            FLAG_SET(16, 'M', TRUE);
        } else
        {
            FLAG_SET(17, 'P', FALSE);
            FLAG_SET(16, 'M', FALSE);
        }
        FLAG_SET(20, 'U', IS_UNDEAD(victim) && IS_AFFECTED(ch, AFF_DETECT_UNDEAD));
        FLAG_SET(23, 'R', RIDDEN(victim));
        FLAG_SET(26, 'I', IS_AFFECTED(victim, AFF_IMP_INVIS));
        FLAG_SET(29, 'E', IS_EVIL(victim) && IS_AFFECTED(ch, AFF_DETECT_EVIL));
        FLAG_SET(32, 'G', IS_GOOD(victim) && IS_AFFECTED(ch, AFF_DETECT_GOOD));
        FLAG_SET(35, 'S', IS_AFFECTED(victim, AFF_SANCTUARY));
        FLAG_SET(34, 'W', IS_AFFECTED(victim, AFF_SANCTUARY));

        if (IS_AFFECTED(victim, AFF_BLACK_SHROUD))
        {
            FLAG_SET(35, 'B', TRUE);
            FLAG_SET(34, 'D', TRUE);
        }

        FLAG_SET(38, 'C', IS_AFFECTED(victim, AFF_CAMOUFLAGE));
        FLAG_SET(41, 'F', IS_AFFECTED(victim, AFF_FADE));
        FLAG_SET(44, 'E', IS_AFFECTED(victim, AFF_EARTHFADE));
        FLAG_SET(47, 'P', IS_AFFECTED(victim, AFF_PROTECTION));

        if (flags)
            char_puts(FLAGS, ch);
    }

    if (victim->invis_level >= LEVEL_HERO)
        act_puts("[{WWizi{x] ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
    if (victim->incog_level >= LEVEL_HERO)
        act_puts("[{DIncog{x] ", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);

    if (IS_NPC(victim) && victim->position == victim->start_pos)
    {
        const char *p = format_descr(victim->long_descr, ch);

        if (!IS_NULLSTR(p))     /* for the hell of "It" (#2006) :) */
            act_puts(p, ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
        return;
    }


    if (IS_IMMORTAL(victim))
        act_puts("{W", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);
    else
        act_puts("{x", ch, NULL, victim, TO_CHAR | ACT_NOLF, POS_DEAD);

    switch (victim->position)
    {
        case POS_DEAD:
            msg = "$N {xis DEAD!!";
            break;

        case POS_MORTAL:
            msg = "$N {xis mortally wounded.";
            break;

        case POS_INCAP:
            msg = "$N {xis incapacitated.";
            break;

        case POS_STUNNED:
            msg = "$N {xis lying here stunned.";
            break;

        case POS_SLEEPING:
            if (victim->on == NULL)
            {
                msg = "$N {xis sleeping here.";
                break;
            }

            arg = victim->on;
            if (IS_SET(victim->on->value[2], SLEEP_AT))
                msg = "$N {xis sleeping at $p.";
            else if (IS_SET(victim->on->value[2], SLEEP_ON))
                msg = "$N {xis sleeping on $p.";
            else
                msg = "$N {xis sleeping in $p.";
            break;

        case POS_RESTING:
            if (victim->on == NULL)
            {
                msg = "$N {xis resting here.";
                break;
            }

            arg = victim->on;
            if (IS_SET(victim->on->value[2], REST_AT))
                msg = "$N {xis resting at $p.";
            else if (IS_SET(victim->on->value[2], REST_ON))
                msg = "$N {xis resting on $p.";
            else
                msg = "$N {xis resting in $p.";
            break;

        case POS_SITTING:
            if (victim->on == NULL)
            {
                msg = "$N {xis sitting here.";
                break;
            }

            arg = victim->on;
            if (IS_SET(victim->on->value[2], SIT_AT))
                msg = "$N {xis sitting at $p.";
            else if (IS_SET(victim->on->value[2], SIT_ON))
                msg = "$N {xis sitting on $p.";
            else
                msg = "$N {xis sitting in $p.";
            break;

        case POS_STANDING:
            if (victim->on == NULL)
            {
                if (!IS_NPC(victim)
                    &&  !IS_SET(ch->comm, COMM_BRIEF)
                    && victim->pcdata->title)
                    arg = victim->pcdata->title;

                if (MOUNTED(victim))
                {
                    arg3 = MOUNTED(victim);
                    msg = "$N{x$t {xis here, riding $I.";
                } else
                    msg = "$N{x$t {xis here.";
                break;
            }

            arg = victim->on;
            if (IS_SET(victim->on->value[2],STAND_AT))
                msg = "$N {xis standing at $p.";
            else if (IS_SET(victim->on->value[2],STAND_ON))
                msg = "$N {xis standing on $p.";
            else
                msg = "$N {xis standing in $p.";
            break;

        case POS_FIGHTING:
            if (victim->fighting == NULL)
            {
                arg = "thin air??";
                flags = ACT_TRANS;
                msg = "$N {xis here, fighting with $t.";
            } else if (victim->fighting == ch)
            {
                arg = "YOU!";
                flags = ACT_TRANS;
                msg = "$N {xis here, fighting with $t.";
            } else if (victim->in_room == victim->fighting->in_room)
            {
                arg = victim->fighting;
                msg = "$N {xis here, fighting with $i.";
            } else
            {
                arg = "someone who left??";
                flags = ACT_TRANS;
                msg = "$N {xis here, fighting with $t.";
            }
            break;
    }

    act_puts3(msg, ch, arg, victim, arg3, TO_CHAR | ACT_FORMSH | flags, POS_DEAD);

}

char* wear_loc_names[] =
{
    "<ÏÓ×ÅÝÁÅÔ>          $t",
    "<ÎÁ ÐÁÌØÃÅ>         $t",
    "<ÎÁ ÐÁÌØÃÅ>         $t",
    "<ÎÁ ÛÅÅ>            $t",
    "<× ÕÈÅ>             $t",
    "<ÎÁ ÔÅÌÅ>           $t",
    "<ÎÁ ÇÏÌÏ×Å>         $t",
    "<ÎÁ ÎÏÇÁÈ>          $t",
    "<ÎÁ ÓÔÕÐÎÑÈ>        $t",
    "<ÎÁ ÒÕËÁÈ>          $t",
    "<ÎÁ ÐÌÅÞÁÈ>         $t",
    "<ÝÉÔ>               $t",
    "<×ÏËÒÕÇ ÔÅÌÁ>       $t",
    "<×ÏËÒÕÇ ÔÁÌÉÉ>      $t",
    "<ÎÁ ÌÅ×ÏÍ ÚÁÐÑÓÔØÅ> $t",
    "<ÎÁ ÐÒÁ×ÏÍ ÚÁÐÑÓÔØÅ>$t",
    "<ÏÒÕÖÉÅ>            $t",
    "<ÚÁÖÁÔÏ × ÒÕËÁÈ>    $t",
    "<ÌÅÔÁÅÔ ÒÑÄÏÍ>      $t",
    "<ÔÁÔÕÉÒÏ×ËÁ ÒÅÌÉÇÉÉ>$t",
    "<×ÔÏÒÏÅ ÏÒÕÖÉÅ>     $t",
    "<ËÌÁÎÏ×ÙÊ ÚÎÁË>     $t",
    "<×ÏÔËÎÕÔÏ>          $t",
    "<× ÓÌÏÔÅ ÒÁÓÛÉÒÅÎÉÑ>$t",
    "<ÎÁ È×ÏÓÔÅ>         $t",
    "<ÎÁ ÌÉÃÅ>           $t",
};

void show_obj_to_char(CHAR_DATA *ch, OBJ_DATA *obj, flag32_t wear_loc)
{
    bool can_see = can_see_obj(ch, obj);
    act(wear_loc_names[wear_loc], ch,  can_see ? format_obj_to_char(obj, ch, TRUE) : "ÞÔÏ-ÔÏ",  NULL, TO_CHAR | (can_see ? 0 : ACT_TRANS));
}

void do_lore_area(CHAR_DATA *ch, const char* argument)
{
    int chance;
    int index;
    int mana;
    AREA_DATA *pArea;
    char arg[MAX_INPUT_LENGTH];

    mana = SKILL(sn_lookup("lore"))->min_mana;
    if (ch->mana < mana)
    {
        char_act("You don't have enough mana.", ch);
        return;
    }
    ch->mana -= mana;

    pArea = NULL;
    index = number_range(2, area_last->vnum);

    argument = one_argument(argument, arg, sizeof(arg));
    chance = get_skill(ch, sn_lookup("lore"));
    chance -= 20;
    if (IS_AFFECTED(ch, AFF_BLIND))
        chance = 0;

    if (chance == 80 || number_percent() < chance)
        pArea = ch->in_room->area;
    else
        pArea = area_lookup(index);

    if (pArea != NULL)
        char_printf(ch, "You are in %s{x area.\n", pArea->name);
    else
        log_printf("Invalid area vnum generated : %d !", index);

    return;
}

void show_char_to_char_1(CHAR_DATA *victim, CHAR_DATA *ch)
{
    OBJ_DATA *obj;
    int i;
    int percent;
    bool found;
    char *msg;
    const char *desc;
    const char *immdesc;
    CHAR_DATA *doppel = victim;
    CHAR_DATA *mirror = victim;

    if (is_affected(victim, gsn_doppelganger))
    {
        if (IS_NPC(ch)  || !IS_SET(ch->plr_flags, PLR_HOLYLIGHT))
        {
            doppel = victim->doppel;

            if (is_affected(victim, gsn_mirror))
                mirror = victim->doppel;
        }
    }

    if (can_see(victim, ch))
    {
        if (ch == victim)
            act("$n looks at $gn{himself}.", ch, NULL, NULL, TO_ROOM);
        else
        {
            act("$n looks at you.", ch, NULL, victim, TO_VICT);
            act("$n looks at $N.", ch, NULL, victim, TO_NOTVICT);
        }
    }

    if (IS_NPC(doppel))
        desc = mlstr_cval(doppel->description, ch);
    else
        desc = mlstr_mval(doppel->description);

    immdesc = mlstr_cval(victim->immdesc, ch);

    if (IS_IMMORTAL(ch) && !IS_NULLSTR(immdesc))
    {
        char_act("------------- DESCRIPTION FROM GOD'S --------------", ch);
        act_puts("$t", ch, immdesc, victim, TO_CHAR, POS_DEAD);
        char_act("---------------------------------------------------", ch);
    }

    if (!IS_NULLSTR(desc))
        act_puts(desc, ch, NULL, victim, TO_CHAR, POS_DEAD);
    else
        act_puts("You see nothing special about $gN{him}.",   ch, NULL, victim, TO_CHAR, POS_DEAD);

    if (MOUNTED(victim))
        act_puts("{x$N is riding $i.",   ch, MOUNTED(victim), victim, TO_CHAR, POS_DEAD);
    if (RIDDEN(victim))
        act_puts("{x$N is being ridden by $i.", ch, RIDDEN(victim), victim, TO_CHAR, POS_DEAD);

    if (victim->max_hit > 0)
        percent = (100 * victim->hit) / victim->max_hit;
    else
        percent = -1;

    if (percent >= 100)
        msg = "{C× ÐÒÅËÒÁÓÎÏÍ ÓÏÓÔÏÑÎÉÉ{x.";
    else if (percent >= 90)
        msg = "{bÉÍÅÅÔ ÎÅÓËÏÌØËÏ ÃÁÒÁÐÉÎ{x.";
    else if (percent >= 75)
        msg = "{BÉÍÅÅÔ ÎÅÓËÏÌØËÏ ÒÁÎ É ÓÉÎÑËÏ×{x.";
    else if (percent >= 50)
        msg = "{y$gN{×ÅÓØ} $gN{ÐÏËÒÙÔ} ÕÖÁÓÎÙÍÉ ÒÁÎÁÍÉ{x.";
    else if (percent >= 30)
        msg = "{MÉÓÔÅËÁÅÔ ËÒÏרÀ{x.";
    else if (percent >= 15)
        msg = "{RÂØÅÔÓÑ × ÁÇÏÎÉÉ{x.";
    else if (percent >= 0)
        msg = "{rËÏÒÞÉÔÓÑ ÎÁ ÚÅÍÌÅ{x.";
    else
        msg = "{DÐÒÁËÔÉÞÅÓËÉ $gN{ÍÅÒÔ×}{x.";

    if (!IS_IMMORTAL(doppel))
    {
        act_puts("{x($t) ",
            ch, race_name(doppel->race), NULL, TO_CHAR | ACT_NOLF, POS_DEAD);
        if (!IS_NPC(doppel))
            act_puts("($t) ",
                ch, class_name(doppel), NULL, TO_CHAR | ACT_NOLF, POS_DEAD);
        act_puts("($t) ",
            ch, flag_string(sex_table, doppel->sex), NULL, TO_CHAR | ACT_NOLF, POS_DEAD);
    }

    act_puts3("$t$N$U ",
        ch, IS_IMMORTAL(victim) ? "{C" : str_empty, victim, IS_IMMORTAL(victim) ? "{x" : str_empty, TO_CHAR | ACT_NOLF, POS_DEAD);
    act_puts(msg, ch, NULL, victim, TO_CHAR | ACT_NOUCASE, POS_DEAD);

    found = FALSE;
    for (i = 0; show_order[i] != -1; i++)
        if ((obj = get_eq_char(mirror, show_order[i]))
        && can_see_obj(ch, obj))
        {
            if (!found)
            {
                char_act(str_empty, ch);
                act("$N is using:", ch, NULL, victim, TO_CHAR);
                found = TRUE;
            }

            show_obj_to_char(ch, obj, show_order[i]);
        }

    for (obj = mirror->carrying; obj; obj = obj->next_content)
        if (obj->wear_loc == WEAR_STUCK_IN
        && can_see_obj(ch, obj))
        {
            if (!found)
            {
                char_act(str_empty, ch);
                act("$N is using:", ch, NULL, victim, TO_CHAR);
                found = TRUE;
            }
            show_obj_to_char(ch, obj, WEAR_STUCK_IN);
        }

    if (victim != ch
    && (!IS_IMMORTAL(victim) || IS_IMMORTAL(ch))
    && !IS_NPC(ch)
    && number_percent() < get_skill(ch, gsn_peek))
    {
        act("You peek at the inventory:", ch, NULL, NULL, TO_CHAR);
        check_improve(ch, gsn_peek, TRUE, 4);
        show_list_to_char(mirror->carrying, ch, TRUE, TRUE);
    }
}

void show_char_to_char(CHAR_DATA *list, CHAR_DATA *ch)
{
    CHAR_DATA *rch;
    int life_count = 0;

    for (rch = list; rch; rch = rch->next_in_room)
    {
        if (rch == ch  || (!IS_TRUSTED(ch, rch->incog_level)  && ch->in_room != rch->in_room))
            continue;

        if (!IS_TRUSTED(ch, rch->invis_level))
        {
            AREA_DATA *pArea;

            if (!IS_NPC(rch))
                continue;

            pArea = area_vnum_lookup(rch->pIndexData->vnum);

            if (pArea == NULL  || !IS_BUILDER(ch, pArea))
                continue;
        }

        if (can_see(ch, rch))
            show_char_to_char_0(rch, ch);
        else
        {
            if (room_is_dark(ch) && IS_AFFECTED(rch, AFF_INFRARED))
                act("You see {rglowing red eyes{x watching YOU!",  ch, NULL, NULL, TO_CHAR);
            life_count++;
        }
    }

    if (list->in_room == ch->in_room    && life_count   && IS_AFFECTED(ch, AFF_DETECT_LIFE))
        act("You feel $j more life $qj{forms} in the room.",    ch, (const void*) life_count, NULL, TO_CHAR);
}

DO_FUN(do_clear)
{
    if (!IS_NPC(ch))
        char_puts("\033[0;0H\033[2J", ch);
}

/* changes your scroll */
DO_FUN(do_scroll)
{
    char arg[MAX_INPUT_LENGTH];
    int lines;

    one_argument(argument, arg, sizeof(arg));

    if (arg[0] == '\0')
    {
        act_puts("You currently display $j lines per page.",
            ch, (const void *) (ch->lines + 2), NULL, TO_CHAR, POS_DEAD);
        return;
    }

    if (!is_number(arg))
    {
        act("You must provide a number.", ch, NULL, NULL, TO_CHAR);
        return;
    }

    lines = atoi(arg);
    if (lines < SCROLL_MIN || lines > SCROLL_MAX)
    {
        act_puts3("Valid scroll range is $j..$J.",
            ch, (const void *) SCROLL_MIN, NULL, (const void *) SCROLL_MAX, TO_CHAR, POS_DEAD);
        return;
    }

    act_puts("Scroll set to $j lines.",
        ch, (const void *) lines, NULL, TO_CHAR, POS_DEAD);
    ch->lines = lines - 2;
}

/* RT does socials */
DO_FUN(do_socials)
{
    char arg[MAX_INPUT_LENGTH];
    int  i;
    BUFFER *output;

    one_argument(argument, arg, sizeof(arg));

    if (arg[0] == '\0')
    {
        do_alist(ch, "social");
        return;
    }

    if(str_cmp(arg,"list"))
    {
        act("Syntax: {C'socials'{x or {C'socials list'{x", ch, NULL, NULL, TO_CHAR);
        return;
    }

    output = buf_new(-1);

    for (i = 0; i < socials.nused; i++)
    {
        social_t *soc = (social_t*) VARR_GET(&socials, i);

        buf_printf(output, "%-12s  %-12s  ", soc->name, soc->alias);
        buf_printf(output, "%s\n\r", soc->description);

    }

    buf_printf(output,"\n\r");
    page_to_char(buf_string(output), ch);
    buf_free(output);

}

/* RT Commands to replace news, motd, imotd, etc from ROM */
DO_FUN(do_motd)
{
    do_help(ch, "motd");
}

DO_FUN(do_imotd)
{
    do_help(ch, "imotd");
}

DO_FUN(do_rules)
{
    do_help(ch, "rules");
}

DO_FUN(do_story)
{
    do_help(ch, "story");
}

DO_FUN(do_wizlist)
{
    do_help(ch, "wizlist");
}

DO_FUN(do_form)
{
    char arg[MAX_INPUT_LENGTH];
    int rulecl, i, max;
    int sex_flip[] = {SEX_MALE, SEX_FEMALE, SEX_NEUTRAL, SEX_PLURAL};
    lang_t *l;

    argument = one_argument(argument, arg, sizeof(arg));
    if ((l = varr_get(&langs, ch->lang)) == NULL)
    {
        char_act("You have unknown language.", ch);
        return;
    }
    if (IS_NULLSTR(arg) || IS_NULLSTR(argument))
    {
        do_help(ch, "'WORD FORMS'");
        return;
    }
    if (!str_prefix(arg, "genders") || !str_prefix(arg, "ÒÏÄÏ×ÙÅ"))
    {
        rulecl = RULES_GENDER;
        max = 4;
    } else if (!str_prefix(arg, "cases") || !str_prefix(arg, "ÐÁÄÅÖÎÙÅ"))
    {
        rulecl = RULES_CASE;
        max = 7;
    } else if (!str_prefix(arg, "qtys") || !str_prefix(arg, "ËÏÌÉÞÅÓÔ×ÅÎÎÙÅ"))
    {
        rulecl = RULES_QTY;
        max = 6;
    } else
    {
        do_help(ch, "'WORD FORMS'");
        return;
    }

    if (irule_find(l->rules + rulecl, arg) != NULL)
        char_act("Found implicit rule.", ch);
    if (erule_lookup(l->rules + rulecl, arg) != NULL)
        char_act("Found explicit rule.", ch);

    for (i=0; i < max; i++)
    {
        if (rulecl == RULES_GENDER)
            act_puts3("$J($j). [$gj{$T}{x]", ch, (const void *) (sex_flip[i]), argument, (const void *) i, TO_CHAR, POS_DEAD);
        if (rulecl == RULES_CASE)
            act_puts("$j. [$cj{$T}{x]", ch, (const void *)i, argument, TO_CHAR, POS_DEAD);
        if (rulecl == RULES_QTY)
            act_puts("$j. [$qj{$T}{x]", ch, (const void *)i, argument, TO_CHAR, POS_DEAD);
    }
}

/* RT this following section holds all the auto commands from ROM, as well as
   replacements for config */
#define do_print_sw(ch, swname, sw) \
                char_printf(ch, "%-16s %s\n", swname, sw ? "ON" : "OFF");

char *prepare_prompt(const char *str)
{
    char new_prompt[MAX_STRING_LENGTH];
    char *temp = new_prompt;
    while (*str)
        if (*str != '{')
            *(temp++) = *(str++);
        else
        {
            *(temp++) = *(str);
            *(temp++) = *(str++);
        }
    return strdup(new_prompt);

}

DO_FUN(do_prompt)
{
    const char *prompt;
    char *temp;

    if (argument[0] == '\0')
    {
        bust_a_prompt(ch);
        return;
    }
    if (!str_prefix(argument, "show"))
    {

        temp = prepare_prompt(ch->prompt);
        char_printf(ch, "Current prompt is '%s'.\n", temp);
        free(temp);

//                char_printf(ch, "ôÅËÕÝÉÊ ÐÒÏÍÐÔ '%s'.\n", ch->prompt);
        return;
    }

    if (!str_cmp(argument, "all") || !str_cmp(argument, "default"))
        prompt = str_dup(DEFAULT_PROMPT);
    else
        prompt = str_printf("%s ", argument);

    free_string(ch->prompt);
    ch->prompt = prompt;

    temp = prepare_prompt(ch->prompt);
    char_printf(ch, "Prompt set to '%s'.\n", temp);
    free(temp);

//        char_printf(ch, "ðÒÏÍÐÔ ÕÓÔÁÎÏ×ÌÅÎ '%s'.\n", ch->prompt);
}

DO_FUN(do_nofollow)
{
    if (IS_NPC(ch))
    {
        act("Huh?", ch, NULL, NULL, TO_CHAR);
        return;
    }

    TOGGLE_BIT(ch->plr_flags, PLR_NOFOLLOW);
    if (IS_SET(ch->plr_flags,PLR_NOFOLLOW))
    {
        act("You no longer accept followers.", ch, NULL, NULL, TO_CHAR);
        die_follower(ch);
    } else
        act("You now accept followers.", ch, NULL, NULL, TO_CHAR);
}
DO_FUN(do_notrack)
{
    if (IS_NPC(ch))
        return;

    TOGGLE_BIT(ch->comm, COMM_TRACK);
    if (IS_SET(ch->comm, COMM_TRACK))
        char_act("Now you will follow tracks.", ch);
    else
        char_act("Now you will not follow tracks.", ch);
}


DO_FUN(do_nosummon)
{
    if (IS_NPC(ch))
        return;

    TOGGLE_BIT(ch->plr_flags, PLR_NOSUMMON);
    if (IS_SET(ch->plr_flags, PLR_NOSUMMON))
        char_act("ôÙ ÍÏÖÅÛØ ÂÙÔØ ÐÒÉÚ×ÁÎ ÔÏÌØËÏ ÉÇÒÏËÁÍÉ × ÐÒÅÄÅÌÁÈ Ô×ÏÅÇÏ PK ÒÁÎÇÁ.", ch);
    else
        char_act("ôÙ ÍÏÖÅÛØ ÂÙÔØ ÐÒÉÚ×ÁÎ ËÅÍ ÕÇÏÄÎÏ.", ch);
}

void do_look_in(CHAR_DATA* ch, const char *argument)
{
    OBJ_DATA *obj;
    clan_t *clan = NULL;

    if ((obj = get_obj_here(ch, argument)) == NULL)
    {
        act("You don't see that here.", ch, NULL, NULL, TO_CHAR);
        return;
    }

    switch (obj->pIndexData->item_type)
    {
        default:
            act("That is not a container.", ch, NULL, NULL, TO_CHAR);
            break;

        case ITEM_DRINK_CON:
            if (obj->value[1] <= 0 && obj->value[0] != -1)
            {
                act("It is empty.", ch, NULL, NULL, TO_CHAR);
                break;
            }

            act("It's $t filled with a $T liquid.", 
                ch, 
                (const void *) (obj->value[1] == obj->value[0] ? "full-" :
                obj->value[1] < obj->value[0] / 4 ? "less than half-" :
                obj->value[1] < 3 * obj->value[0] / 4 ?
                "about half-" : "more than half-"),
                (const void *) liquid_color(obj->value[2]),
                TO_CHAR | ACT_TRANS);
            break;

        case ITEM_CONTAINER:
        case ITEM_SCABBARD:
        case ITEM_CORPSE_NPC:
        case ITEM_CORPSE_PC:
            clan = is_clan_altar(obj);
            if ((clan == NULL) || (clan != CLAN(ch->clan)))
                if (IS_SET(obj->value[1], CONT_CLOSED))
                {
                    act("It is closed.", ch, NULL, NULL, TO_CHAR);
                    if (!IS_IMMORTAL(ch))
                        break;
                }

            act_puts("$p holds : ", ch, obj, NULL, TO_CHAR, POS_DEAD);
            show_list_to_char(obj->contains, ch, TRUE, TRUE);
            break;

        }
}

DO_FUN(do_look)
{
    char arg1 [MAX_INPUT_LENGTH];
    char arg2 [MAX_INPUT_LENGTH];
    char arg3 [MAX_INPUT_LENGTH];
    EXIT_DATA *pexit;
    CHAR_DATA *victim;
    //CHAR_DATA *person;
    OBJ_DATA *obj;
    ED_DATA *ed;
    int door;
    int number,count;
    //int numpeople;
    //ROOM_INDEX_DATA *location;
    riddle_t *riddle;

    if (ch->desc == NULL)
        return;

    if (ch->position < POS_SLEEPING)
    {
        char_act("You can't see anything but stars!", ch);
        return;
    }

    if (ch->position == POS_SLEEPING)
    {
        char_act("You can't see anything, you're sleeping!", ch);
        return;
    }

    argument = one_argument(argument, arg1, sizeof(arg1));
    argument = one_argument(argument, arg2, sizeof(arg2));
    number = number_argument(arg1, arg3, sizeof(arg3));
    count = 0;

    if (arg1[0] == '\0' || !str_cmp(arg1, "auto"))
    {

        /* 'look' or 'look auto' */
        if (!room_is_dark(ch) && check_blind_raw(ch))
        {

            const char *name;
            const char *engname;

            name = mlstr_cval(ch->in_room->name, ch);
            engname = mlstr_mval(ch->in_room->name);
            act_puts("{W{W$t", ch, name, NULL, TO_CHAR | ACT_NOLF, POS_DEAD);
            if (ch->lang && name != engname)
                act_puts(" ($t){R{x", ch, engname, NULL, TO_CHAR | ACT_NOLF, POS_DEAD);
            else
                act_puts("{R{x", ch, NULL, NULL, TO_CHAR | ACT_NOLF, POS_DEAD);

            if (IS_IMMORTAL(ch) || IS_BUILDER(ch, ch->in_room->area))
                act_puts(" [$j]", ch, (const void *) ch->in_room->vnum, NULL, TO_CHAR | ACT_NOLF, POS_DEAD);

            char_act(str_empty, ch);

            if (arg1[0] == '\0' ||
                (!IS_NPC(ch) && !IS_SET(ch->comm, COMM_BRIEF)))
                act_puts(mlstr_cval(ch->in_room->description, ch), ch, ch->in_room, NULL, TO_CHAR, POS_DEAD);

            if (!IS_NPC(ch) && IS_SET(ch->plr_flags, PLR_AUTOEXIT))
            {
                char_act(str_empty, ch);
                do_exits(ch, "auto");
            }
        } else
            char_act("It is pitch black...", ch);

        if (IS_SET(ch->plr_flags, PLR_AUTOWEATHER) && IS_OUTDOORS(ch))
            show_weather(ch);

        show_list_to_char(ch->in_room->contents, ch, FALSE, FALSE);
        show_char_to_char(ch->in_room->people, ch);
        if (!str_cmp(arg1, "auto"))
            relation_effect(ch);

        return;
    }

    if (!check_blind(ch))
        return;

    if (!str_cmp(arg1, "i")
    || !str_cmp(arg1, "in")
    || !str_cmp(arg1,"on")
    || !str_cmp(arg1, "×"))
    {
        /* 'look in' */
        if (arg2[0] == '\0')
        {
            char_act("Look in what?", ch);
            return;
        }
        do_look_in(ch, arg2);
        return;
    }

    if ((victim = get_char_room(ch, arg1)) != NULL)
    {
        show_char_to_char_1(victim, ch);

        /* Love potion */
        if (is_affected(ch, gsn_love_potion) && (victim != ch) && !IS_AFFECTED(victim, AFF_CHARM))
        {
            AFFECT_DATA af;

            affect_strip(ch, gsn_love_potion);

            if (ch->master)
                stop_follower(ch);
            add_follower(ch, victim);
            ch->leader = victim;

            af.where        = TO_AFFECTS;
            af.type         = gsn_charm_person;
            af.level        = ch->level;
            af.duration     = number_fuzzy(victim->level / 4);
            af.bitvector    = AFF_CHARM;
            af.modifier     = 0;
            af.location     = 0;
            affect_to_char(ch, &af);

            act("Isn't $n just so nice?", victim, NULL, ch, TO_VICT);
            act("$N looks at you with adoring eyes.", victim, NULL, ch, TO_CHAR);
            act("$N looks at $n with adoring eyes.", victim, NULL, ch, TO_NOTVICT);
        }
        return;
    }

    for (obj = ch->carrying; obj != NULL; obj = obj->next_content)
    {
        if (can_see_obj(ch, obj))
        {
            /* player can see object */
            if (obj->pIndexData->item_type == ITEM_RIDDLE &&
                is_name(arg3, obj->pIndexData->name))
            {
                riddle = riddle_lookup(obj->pIndexData->value[2]);
                if (riddle)
                    char_act(mlstr_cval(riddle->question, ch), ch);
                else
                    char_act("Somthing is wrong.", ch);
                return;
            }

            ed = ed_lookup(arg3, obj->ed);

            if (ed != NULL)
            {
                if (++count == number)
                {
                    char_mlact(ed->description, ch);
                    return;
                } else
                    continue;
            }

            ed = ed_lookup(arg3, obj->pIndexData->ed);

            if (ed != NULL)
            {
                if (++count == number)
                {
                    char_mlact(ed->description, ch);
                    return;
                } else
                    continue;
            }

            if (is_name(arg3, obj->name))
                if (++count == number)
                {
                    char_act("You see nothing special about it.", ch);
                    return;
                }
        }
    }

    for (obj = ch->in_room->contents; obj != NULL; obj = obj->next_content)
    {
        if (can_see_obj(ch, obj))
        {
            if (obj->pIndexData->item_type == ITEM_RIDDLE &&
                is_name(arg3, obj->pIndexData->name))
            {
                riddle = riddle_lookup(obj->pIndexData->value[2]);
                if (riddle)
                    char_act(mlstr_cval(riddle->question, ch), ch);
                else
                    char_act("Somthing is wrong.", ch);
                return;
            }

            ed = ed_lookup(arg3, obj->ed);
            if (ed != NULL)
            {
                if (++count == number)
                {
                    char_mlact(ed->description, ch);
                    return;
                }
            }

            ed = ed_lookup(arg3, obj->pIndexData->ed);
            if (ed != NULL)
            {
                if (++count == number)
                {
                    char_mlact(ed->description, ch);
                    return;
                }
            }
        }

        if (is_name(arg3, obj->name))
        {
            if (++count == number)
            {
                if (obj->pIndexData->vnum == OBJ_VNUM_WANTED_DESK)
                {
                    show_wanted_desk(ch);
                    return;
                } else
                {
                    if (obj->pIndexData->item_type == ITEM_WINDOW) // For look windows
                    {
                        look_window(ch, obj);
                        return;
                    }

                    if (obj->pIndexData->item_type == ITEM_PORTAL)
                    {
                        look_gate(ch, obj);
                        return;
                    }

                    act_puts(format_descr(obj->description, ch), ch, obj, obj, TO_CHAR, POS_DEAD);
                    return;
                }
            }
        }
    }

    ed = ed_lookup(arg3, ch->in_room->ed);
    if (ed != NULL)
    {
        if (++count == number)
        {
            char_mlact(ed->description, ch);
            return;
        }
    }

    if (count > 0 && count != number)
    {
        if (count == 1)
            act_puts("You only see one $t here.", ch, arg3, NULL, TO_CHAR, POS_DEAD);
        else
            act_puts("You only see $j of those here.",
                ch, (const void*) count, NULL, TO_CHAR, POS_DEAD);
        return;
    }

    if (!str_cmp(arg1, "n")
    || !str_cmp(arg1, "north")
    || !str_cmp(arg1, "Ó")
    || !str_cmp(arg1, "ÓÅ×ÅÒ"))
        door = 0;
    else if (!str_cmp(arg1, "e")
    || !str_cmp(arg1, "east")
    || !str_cmp(arg1, "×")
    || !str_cmp(arg1, "×ÏÓÔÏË"))
        door = 1;
    else if (!str_cmp(arg1, "s")
    || !str_cmp(arg1, "south")
    || !str_cmp(arg1, "À")
    || !str_cmp(arg1, "ÀÇ"))
        door = 2;
    else if (!str_cmp(arg1, "w")
    || !str_cmp(arg1, "west")
    || !str_cmp(arg1, "Ú")
    || !str_cmp(arg1, "ÚÁÐÁÄ"))
        door = 3;
    else if (!str_cmp(arg1, "u")
    || !str_cmp(arg1, "up" )
    || !str_cmp(arg1, "××")
    || !str_cmp(arg1, "××ÅÒÈ"))
        door = 4;
    else if (!str_cmp(arg1, "d")
    || !str_cmp(arg1, "down")
    || !str_cmp(arg1, "Î")
    || !str_cmp(arg1, "×Î")
    || !str_cmp(arg1, "ÎÉÚ")
    || !str_cmp(arg1, "×ÎÉÚ"))
        door = 5;
    else
    {
        char_act("You don't see that here.", ch);
        return;
    }

    /* 'look direction' */
    if ((pexit = ch->in_room->exit[door]) == NULL)
    {
        char_act("îÉÞÅÇÏ ÏÓÏÂÅÎÎÏÇÏ.", ch);
        return;
    }

    if (!IS_NULLSTR(mlstr_mval(pexit->description)))
        char_mlact(pexit->description, ch);
    else
        char_act("Nothing special there.", ch);

    if (pexit->keyword    != NULL
    && pexit->keyword[0] != '\0'
    && pexit->keyword[0] != ' ')
    {
        if (IS_SET(pexit->exit_info, EX_CLOSED))
            act_puts("The $d is closed.", ch, NULL, pexit->keyword, TO_CHAR, POS_DEAD);
        else if (IS_SET(pexit->exit_info, EX_ISDOOR))
            act_puts("The $d is open.", ch, NULL, pexit->keyword, TO_CHAR, POS_DEAD);
    }
}

DO_FUN(do_examine)
{
    char arg[MAX_INPUT_LENGTH];
    OBJ_DATA *obj;

    one_argument(argument, arg, sizeof(arg));

    if (ch->desc == NULL)
        return;

    if (ch->position < POS_SLEEPING)
    {
        act("You can't see anything but stars!", ch, NULL, NULL, TO_CHAR);
        return;
    }

    if (ch->position == POS_SLEEPING)
    {
        act("You can't see anything, you're sleeping!", ch, NULL, NULL, TO_CHAR);
        return;
    }

    if (!check_blind(ch))
        return;

    if (arg[0] == '\0')
    {
        act("Examine what?", ch, NULL, NULL, TO_CHAR);
        return;
    }

    if (!str_cmp(arg, "tattoo") || !str_cmp(arg, "ÔÁÔÕ"))
    {
        do_examine_tattoo (ch, argument);
        return;
    }

    do_look(ch, arg);

    if ((obj = get_obj_here(ch, arg)) != NULL)
    {
        switch (obj->pIndexData->item_type)
        {
            case ITEM_MONEY:
                if (obj->value[0] == 0)
                {
                    if (obj->value[1] == 0)
                        act("Odd...there's no coins in the pile.", ch, NULL, NULL, TO_CHAR);
                    else if (obj->value[1] == 1)
                        act("Wow. One gold coin.", ch, NULL, NULL, TO_CHAR);
                    else
                        char_printf(ch, "There are %d gold coins in this pile.\n", obj->value[1]);
                } else if (obj->value[1] == 0)
                {
                    if (obj->value[0] == 1)
                        act("Wow. One silver coin.", ch, NULL, NULL, TO_CHAR);
                    else
                        char_printf(ch, "There are %d silver coins in this pile.\n", obj->value[0]);
                } else
                    char_printf(ch, "There are %d gold and %d silver coins in this pile.\n", obj->value[1], obj->value[0]);
                break;

            case ITEM_DRINK_CON:
            case ITEM_CONTAINER:
            case ITEM_SCABBARD:
            case ITEM_CORPSE_NPC:
            case ITEM_CORPSE_PC:
                    do_look_in(ch, argument);
                break;
            case ITEM_KEYRING:
                    list_keys(ch, obj);
                    break;
        }
    }
}

/*
 * Thanks to Zrin for auto-exit part.
 */
char dirs[6][2][MAX_INPUT_LENGTH] = 
{
    {"north", "ÓÅ×ÅÒ"},
    {"east",  "×ÏÓÔÏË"},
    {"south", "ÀÇ"},
    {"west",  "ÚÁÐÁÄ"},
    {"up",    "××ÅÒÈ"},
    {"down",  "×ÎÉÚ"}
};

DO_FUN(do_exits)
{
    extern char * const dir_name[];
    EXIT_DATA *pexit;
    bool found;
    bool fAuto;
    int door;

    fAuto  = !str_cmp(argument, "auto");

    if (fAuto)
        act_puts("{C[Exits :", ch, NULL, NULL, TO_CHAR | ACT_NOLF, POS_DEAD);
    else if (IS_IMMORTAL(ch) || IS_BUILDER(ch, ch->in_room->area))
        act_puts("Obvious exits from room $j : ", ch, (const void *) ch->in_room->vnum, NULL, TO_CHAR, POS_DEAD);
    else
        act("Obvious exits : ", ch, NULL, NULL, TO_CHAR);

    found = FALSE;
    for (door = 0; door < MAX_DIR; door++)
    {
        if ((pexit = ch->in_room->exit[door]) != NULL
        && pexit->to_room.r != NULL
        && can_see_room(ch, pexit->to_room.r)
        && !IS_SET(pexit->exit_info, EX_INVIS)
        && check_blind_raw(ch))
        {
            bool show_closed = FALSE;

            if (IS_SET(pexit->exit_info, EX_CLOSED))
            {
                int chance;

                if (IS_IMMORTAL(ch))
                    show_closed = TRUE;
                else if ((chance = get_skill(ch, gsn_perception)))
                {
                    if (number_percent() < chance)
                    {
                        check_improve(ch, gsn_perception, TRUE, 5);
                        show_closed = TRUE;
                    }
                }
                if (!show_closed)
                    continue;
            }

            found = TRUE;
            if (fAuto)
            {
                if (IS_SET(ch->comm2, COMM2_RUSEXIT))
                    act_puts(" $t$T", ch, dirs[door][1], show_closed ? "*" : str_empty, TO_CHAR | ACT_NOLF, POS_DEAD);
                else
                    act_puts(" $t$T", ch, dirs[door][0], show_closed ? "*" : str_empty, TO_CHAR | ACT_NOLF, POS_DEAD);
            }
            else
            {
                act_puts3("{C$t$T{x - $U", ch,
                          fmt_color_str(capitalize(dir_name[door]), 5),
                          show_closed ? "*" : str_empty,
                          (room_dark(pexit->to_room.r) &&
                           !IS_SET(ch->plr_flags, PLR_HOLYLIGHT)) ?
                          "Too dark to tell" :
                          mlstr_cval(pexit->to_room.r->name, ch),
                          TO_CHAR | ACT_NOLF, POS_DEAD);
                if (IS_IMMORTAL(ch) || IS_BUILDER(ch, pexit->to_room.r->area))
                    act_puts(" [$j]", ch, (const void *) pexit->to_room.r->vnum, NULL, TO_CHAR | ACT_NOLF, POS_DEAD);
                char_act(str_empty, ch);
            }
        }
    }

    if (!found)
        act_puts(fAuto ? " none" : "None.", ch, NULL, NULL, TO_CHAR | (fAuto? ACT_NOLF : 0), POS_DEAD);

    if (fAuto)
        act_puts("]{x", ch, NULL, NULL, TO_CHAR, POS_DEAD);
}

DO_FUN(do_worth)
{
    char_printf(ch, "You have %d gold, %d silver", ch->gold, ch->silver);
    if (!IS_NPC(ch) && ch->level < LEVEL_HERO)
        char_printf(ch, ", and %d experience (%d exp to level)",
                    ch->exp, exp_to_level(ch));
    act(".", ch, NULL, NULL, TO_CHAR);

    if (!IS_NPC(ch))
    {
        act_puts("You have killed $j $T",
                 ch, (const void*) ch->pcdata->has_killed,
                 IS_GOOD(ch) ? "non-goods" :
                 IS_EVIL(ch) ? "non-evils" :
                 "non-neutrals",
                 TO_CHAR | ACT_NOLF | ACT_TRANS, POS_DEAD);
        act_puts(" and $j $T.",
                 ch, (const void*) ch->pcdata->anti_killed,
                 IS_GOOD(ch) ? "goods" :
                 IS_EVIL(ch) ? "evils" :
                 "neutrals",
                 TO_CHAR | ACT_TRANS, POS_DEAD);
    }
}
/* GM : ÷ÏÔ ÔÁË × ÏÒÉÇÉÎÁÌÅ. á×ÏÓØ ÐÏÎÁÄÏÂÉÔÓÑ.
    "the Moon", "the Bull", "Deception", "Thunder", "the Horror",
    "the Kingdom", "Rancour", "the Crypt", "the Tutor",
    "Tranquility", "the Great Gods", "Freedom"
*/
char *  const   day_name        [] =
{
    "ìÕÎÙ", "âÙËÁ", "ïÂÍÁÎÁ", "çÒÏÍÁ", "ó×ÏÂÏÄÙ",
    "÷ÅÌÉËÉÈ âÏÇÏ×", "óÏÌÎÃÁ"
};

/*
    "the Winter Wolf", "the Frost Giant",
    "the Spring", "Nature", "Futility", "the Dragon",
    "the Sun", "the Heat", "the Dark Shades",
    "the Long Shadows", "the Ancient Darkness", "the Great Evil"
*/
char *  const   month_name      [] =
{       "÷ÅÌÉËÏÇÏ úÌÁ",                                   // 0
    "úÉÍÎÅÇÏ ÷ÏÌËÁ", "ìÅÄÑÎÏÇÏ çÉÇÁÎÔÁ",              //1,2
    "÷ÅÓÎÙ", "ðÒÉÒÏÄÙ", "ôÝÅÔÎÏÓÔÉ",                  //3,4,5
    "óÏÌÎÃÁ", "öÁÒÙ", "óÒÁÖÅÎÉÑ",                     //6,7,8
    "ôÅÍÎÙÈ ÏÔÔÅÎËÏ×", "ôÅÎÅÊ", "äÌÉÎÎÙÈ ôÅÎÅÊ",      //9,10,11
    "úÉÍÙ",                                           //12
    "óÔÁÒÏÊ òÁÔÉ", "÷ÓÅÏÂÝÅÇÏ óÏÇÌÁÓÉÑ",  "äÒÁËÏÎÁ",
    "äÒÅ×ÎÅÊ ôØÍÙ"
};

DO_FUN(do_time)
{
    extern char str_boot_time[];
    char *suf, *sufh;
    int day;

    day     = time_info.day + 1;

    if (day > 4 && day <  20)
        suf = str_empty;
    else if (day % 10 ==  1)
        suf = str_empty;
    else if (day % 10 ==  2)
        suf = str_empty;
    else if (day % 10 ==  3)
        suf = str_empty;
    else
        suf = str_empty;

    if (time_info.hour == 1 || time_info.hour == 21)
        sufh = str_empty;
    else if (time_info.hour != 0
             && (time_info.hour < 5 || time_info.hour > 21))
        sufh = "Á";
    else
        sufh = "Ï×";

#if 0
    char_printf(ch,
                "óÅÊÞÁÓ %d ÞÁÓÏ× %s, äÅÎØ %s, %d %s íÅÓÑà %s. çÏÄ %d ÏÔ ÓÏÔ×ÏÒÅÎÉÑ ÍÉÒÁ.\n",
                (time_info.hour % 12 == 0) ? 12 : time_info.hour %12,
                time_info.hour >= 12 ? "ÐÏÓÌÅ ÐÏÌÕÄÎÑ" : "ÄÏ ÐÏÌÕÄÎÑ",
                day_name[day % 7],
                day, suf, month_name[time_info.month],
                time_info.year);
#endif
    act_puts3("óÅÊÞÁÓ $j $qj{ÞÁÓÏ×}, äÅÎØ $T, $J", ch, (const void *) time_info.hour, day_name[day % 7], (const void *) day, TO_CHAR | ACT_NOLF | ACT_TRANS, POS_DEAD);
    act_puts(", íÅÓÑà $t.", ch, month_name[time_info.month], NULL, TO_CHAR | ACT_TRANS, POS_DEAD);


    if (!IS_SET(ch->in_room->room_flags,ROOM_INDOORS) || IS_IMMORTAL(ch))
        act_puts("îÁ Ä×ÏÒÅ $t.", ch,
                 (time_info.hour>=5 && time_info.hour<9) ?
                 GETMSG("ÒÁÓÓ×ÅÔÁÅÔ", ch->lang) :
                 (time_info.hour>=9 && time_info.hour<12) ?
                 GETMSG("ÕÔÒÏ", ch->lang) :
                 (time_info.hour>=12 && time_info.hour<18) ?
                 GETMSG("ÐÏÌÄÅÎØ", ch->lang) :
                 (time_info.hour>=18 && time_info.hour<21) ?
                 GETMSG("×ÅÞÅÒ", ch->lang) :
                 GETMSG("ÎÏÞØ", ch->lang),
                 NULL, TO_CHAR, POS_RESTING);

    if (!IS_IMMORTAL(ch))
        return;

    act_puts("\nAstrum Metaphora ÂÙÌ ÚÁÐÕÝÅÎ $t\nóÉÓÔÅÍÎÏÅ ×ÒÅÍÑ $T.",
             ch, str_boot_time, strtime(time(NULL)), TO_CHAR, POS_DEAD);
    if (reboot_counter == -1)
        char_act("ðÒÏÇÒÁÍÍÁ Á×ÔÏÍÁÔÉÞÅÓËÏÊ ÐÅÒÅÚÁÇÒÕÚËÉ ÏÔËÌÀÞÅÎÁ.", ch);
    else
        act_puts("á×ÔÏÍÁÔÉÞÅÓËÁÑ ÐÅÒÅÚÁÇÒÕÚËÁ ÄÏÌÖÎÁ ÐÒÏÉÚÏÊÔÉ ÞÅÒÅÚ $j ÍÉÎÕÔ.", ch, (const void *) reboot_counter, NULL, TO_CHAR, POS_DEAD);
    return;
}

DO_FUN(do_date)
{
    char_printf(ch, "%s\n", strtime(time(NULL)));
}

DO_FUN(do_help)
{
    BUFFER *output;
    output = buf_new(ch->lang);
    help_show(ch, output, argument);
    page_to_char(buf_string(output), ch);
    buf_free(output);
}

#define PC_PRACTICER    123

void do_who_raw (CHAR_DATA * ch, CHAR_DATA * wch, BUFFER * output)
{
    clan_t  * clan    = NULL ;
    clan_t  * clan_ch = NULL ;
    race_t  * r ;
    class_t * cl ;

    if ((cl = class_lookup (wch->class)) == NULL
    || (r  = race_lookup  (wch->race))  == NULL
    || !r->pcdata)
        return ;

    buf_add (output, "{W[") ;

    if (wch->level > LEVEL_HERO)
    {
        switch (wch->level)
        {
            case IMPLEMENTOR: buf_add (output, "{C IMPLEMENTOR ") ; break ;
            case CREATOR:     buf_add (output, "{W   CREATOR   ") ; break ;
            case SUPREME:     buf_add (output, "{W   SUPREME   ") ; break ;
            case DEITY:       buf_add (output, "{W    DEITY    ") ; break ;
            case GOD:         buf_add (output, "{W     GOD     ") ; break ;
            case IMMORTAL:    buf_add (output, "{W   IMMORTAL  ") ; break ;
            case DEMI:        buf_add (output, "{W   DEMIGOD   ") ; break ;
            case ANGEL:       buf_add (output, "{W    ANGEL    ") ; break ;
            case AVATAR:      buf_add (output, "{w    AVATAR   ") ; break ;
//        case HERO:        buf_add (output, "{G    HERO     ") ; break ;
        }

    } else
    {
        if ((ch && (IS_IMMORTAL (ch)
        || ch == wch
        || is_affected (ch, gsn_detection)))
        || wch->level == LEVEL_HERO
        || get_curr_stat (wch, STAT_CHA) < 16
        || IS_SET (wch->comm, PLR_PEACE))
            buf_printf (output, "%3d ", wch->level) ;
        else
            buf_add    (output, "    ") ;

        if (wch->level == LEVEL_HERO)
        {
            if (ch && (IS_IMMORTAL (ch) || is_affected (ch, gsn_detection)))
            {
                buf_add    (output, "{G") ;
                buf_printf (output, "%5.5s",  r->pcdata->who_name) ;
                buf_printf (output, " %3.3s", cl->who_name) ;
            } else buf_add (output, "{GHERO ") ;
        } else
        {
            if (ch && (IS_IMMORTAL (ch) || is_affected (ch, gsn_detection)))
            {
                buf_add    (output, "{w") ;
                buf_printf (output, "%5.5s",  r->pcdata->who_name) ;
                buf_printf (output, " %3.3s", cl->who_name) ;
            } else buf_printf (output, "%5.5s", r->pcdata->who_name) ;
        }
    }

    buf_add (output, "{W]{x") ;

    clan = clan_lookup (wch->clan) ;

    if (ch) clan_ch = clan_lookup (ch->clan) ;

    if (wch->clan && clan
        && (!IS_SET(clan->flags, CLAN_HIDDEN)
        || (ch && (wch->clan == ch->clan
        || IS_IMMORTAL(ch)))))
    {
        int len = (12 - strlen (clan->name)) / 2 ;
        char sName [MAX_INPUT_LENGTH] ;
        sName [0] = '\0' ;

        strnzncat(sName, sizeof(sName), "                      ", len) ;
        strnzcat(sName, sizeof(sName), clan->name) ;
        buf_printf (output, "{W[{Y%-12.12s{W]{x ", sName) ;
    } 
    else
        if (IS_SET(wch->comm, PLR_PEACE)) buf_add (output, "{W[{G   NO PK    {W]{x ") ;
    else
        if (wch->level < PK_MIN_LEVEL)    buf_add (output, "{W[{G   Newbie   {W]{x ") ;
    else
        if (!IS_IMMORTAL(wch))            buf_add (output, "{W[            ]{x ") ;

    if (!IS_SET(ch->comm, COMM_LONG) && !IS_IMMORTAL(wch))
    {
        buf_add (output, "{c[") ;

        if (IS_AFFECTED (wch, AFF_INVIS))      buf_add (output, "{yI") ;
        else                                   buf_add (output, "{y.") ;

        if (IS_AFFECTED (wch, AFF_HIDE))       buf_add (output, "{DH") ;
        else                                   buf_add (output, "{D.") ;

        if (IS_AFFECTED (wch, AFF_TRAP))       buf_add (output, "{DT") ;
        else                                   buf_add (output, "{D.") ;

        if (IS_AFFECTED (wch, AFF_IMP_INVIS))  buf_add (output, "{bI") ;
        else                                   buf_add (output, "{b.") ;

        if (IS_AFFECTED (wch, AFF_CAMOUFLAGE)) buf_add (output, "{yC") ;
        else                                   buf_add (output, "{y.") ;

        if (IS_AFFECTED (wch, AFF_FADE))       buf_add (output, "{gF") ;
        else                                   buf_add (output, "{g.") ;

        if (IS_AFFECTED (wch, AFF_EARTHFADE))  buf_add (output, "{rE") ;
        else                                   buf_add (output, "{r.") ;

        buf_add (output, "{c]{x ") ;
    }

    if (wch->level > LEVEL_HERO)
        buf_add (output, " {x") ;

    if (IS_SET (wch->comm, COMM_AFK)) buf_add (output, "{m[{MAFK{m]{x ") ;
    if (wch->status == PC_PRACTICER) buf_add (output, "{g[{GTeacher{g]{x ") ;

    if (wch->invis_level) buf_printf (output, "({WWizi%d{x) ",  wch->invis_level) ;
    if (wch->incog_level) buf_printf (output, "({DIncog%d{x) ", wch->incog_level) ;

    if (IS_SET(wch->plr_flags, PLR_TESTER))
        buf_printf (output, "{C[{cTester{C] {x");

    if (wch->pcdata->security == 1)
        buf_printf (output, "{C[{cTester{C] {x") ;

//TODO: remove with security need

    if (wch->pcdata->security > 1 && !IS_IMMORTAL (wch))
        buf_printf (output, "{C[{cBuilder{C] {x") ;

    if (IS_SET (wch->plr_flags, PLR_GHOST) && IS_IMMORTAL(ch))
        buf_printf (output, "{C[{cGhost{C] {x") ;

    if (ch && (IS_IMMORTAL(ch) || is_affected (ch, gsn_detection) || ch == wch))
    {
        if (IS_ROOM_AFFECTED (wch->in_room, RAFF_ESPIRIT)
        && is_affected(wch, gsn_evil_spirit))
            buf_add (output, "{C[{cEvil Inside{C]{x ") ;

        if (is_affected(wch, gsn_garble))
            buf_add (output, "{C[{cGarble{C]{x ") ;

        if (is_affected(wch, gsn_deafen))
            buf_add (output, "{C[{cDeafen{C]{x ") ;

        if (IS_AFFECTED (wch, AFF_CHARM))
        {
            if (wch->master != NULL)
            {
                buf_add (output, "{C[{cCharmed by: ") ;
                buf_add (output, wch->master->name) ;
                buf_add (output, "{C]{x ") ;
            } 
            else
            {
                buf_add (output, "{C[{cCharm{C]{x ") ;
                log_printf ("NULL master name, ch %s", wch->name) ;
            }
        }

        if (IS_SET (wch->form, FORM_VAMPIRE))     buf_add (output, "{C[{cVamp{C]{x ")   ;
        if (IS_SET (wch->form, FORM_MECH))        buf_add (output, "{C[{cMech{C]{x ")   ;
        if (IS_SET (wch->form, FORM_DEMON_FIRE))  buf_add (output, "{C[{cDFire{C]{x ")  ;
        if (IS_SET (wch->form, FORM_DEMON_EARTH)) buf_add (output, "{C[{cDEarth{C]{x ") ;
        if (IS_SET (wch->form, FORM_DEMON_WATER)) buf_add (output, "{C[{cDWater{C]{x ") ;
        if (IS_SET (wch->form, FORM_DEMON_AIR))   buf_add (output, "{C[{cDAir{C]{x ")   ;

        if ((wch->doppel != NULL) && (wch->doppel != wch))
        {
            if (wch->doppel->name != NULL)
            {
                buf_add (output, "{C[{cDoppel: ") ;
                buf_add (output, wch->doppel->name) ;
                buf_add (output, "{C]{x ") ;
            } else log_printf ("do_who_raw: NULL doppel name, ch %s", wch->name) ;
        }

        if (wch->guarded_by != NULL)
        {
            buf_add (output, "{C[{cGuarded by: ") ;
            buf_add (output, wch->guarded_by->name) ;
            buf_add (output, "{C]{x ") ;
        }
    }

    if (ch && in_PK (ch, wch) && !IS_IMMORTAL (ch) && !IS_IMMORTAL (wch))
        buf_add (output, "{r[{RPK{r]{x ") ;

    if (wch->pcdata->headprice > 0)
    {
        if (IS_IMMORTAL(ch) || (clan_ch && IS_SET(clan_ch->flags, CLAN_HIDDEN)))
            buf_printf (output, "{G({Wúáëáú {Y%d{G){x ", wch->pcdata->headprice) ;
    }

    if (ch && IS_SET (wch->plr_flags, PLR_WANTED)
    && (IS_IMMORTAL (ch) || (clan_ch && IS_SET(clan_ch->flags, CLAN_RULERS))
    || (clan_ch && IS_SET (clan_ch->flags, CLAN_HIDDEN)) || (ch == wch)))
        buf_add (output, "{R(÷ òïúùóëå){x ") ;

    if (ch && is_affected(wch, gsn_arrest)
    && (IS_IMMORTAL(ch) || (clan_ch && IS_SET(clan_ch->flags, CLAN_RULERS))))
        buf_add (output, "{G(áÒÅÓÔÏ×ÁÎ){x ") ;

    buf_add (output, wch->pcdata->pretitle) ;

    if (IS_IMMORTAL(wch))
    {
        if (wch->imm_name) buf_printf (output, "%s{x",   wch->imm_name) ;
        else               buf_printf (output, "{C%s{x", wch->name) ;
    } 
    else 
        //buf_add (output, wch->name) ;
        (IS_SET(ch->comm2, COMM2_RUSNAMES) && wch->pcdata && wch->pcdata->rusnames[0]) ? buf_add (output, wch->pcdata->rusnames[0]) : buf_add (output, wch->name);


    buf_add (output, wch->pcdata->title) ;

    buf_add (output, "\n") ;
}

#define WHO_F_IMM       (A)             /* imm only                     */
#define WHO_F_PK        (B)             /* PK only                      */
#define WHO_F_TATTOO    (C)             /* same tattoo only             */
#define WHO_F_CLAN      (D)             /* clan only                    */
#define WHO_F_RCLAN     (E)             /* specified clans only         */
#define WHO_F_RRACE     (F)             /* specified races only         */
#define WHO_F_RCLASS    (G)             /* specified classes only       */

DO_FUN(do_who)
{
    BUFFER *output;
    DESCRIPTOR_DATA *d;
    int flags = 0;

    int iLevelLower = 0;
    int iLevelUpper = MAX_LEVEL-1;

    int tattoo_vnum = 0;    /* who tattoo data */
    OBJ_DATA *obj;

    int nNumber;
    int nMatch = 0;
    int count = 0;

    int n;

    const char *clan_names = str_empty;
    const char *race_names = str_empty;
    const char *class_names = str_empty;

    /*
     * Parse arguments.
     */
    nNumber = 0;
    for (;;)
    {
        int i;
        char arg[MAX_INPUT_LENGTH];

        argument = one_argument(argument, arg, sizeof(arg));
        if (arg[0] == '\0')
            break;

        if (!str_prefix(arg, "immortals")
        || !str_prefix(arg, "ÉÍÍÏÒÔÁÌÙ")
        || !str_prefix(arg, "ÂÏÇÉ"))
        {
            SET_BIT(flags, WHO_F_IMM);
            continue;
        }

        if (!str_cmp(arg, "pk")
        || !str_cmp(arg, "ÐË"))
        {
            SET_BIT(flags, WHO_F_PK);
            continue;
        }

        if (!str_cmp(arg, "tattoo")
        || !str_cmp(arg, "ÔÁÔÕ"))
        {
            if ((obj = get_eq_char(ch, WEAR_TATTOO)) == NULL)
            {
                act("õ ÔÅÂÑ ÐÏËÁ ÎÅÔ ÔÁÔÕÉÒÏ×ËÉ!", ch, NULL, NULL, TO_CHAR);
                goto bail_out;
            }
            SET_BIT(flags, WHO_F_TATTOO);
            tattoo_vnum = obj->pIndexData->vnum;
            continue;
        }

        if (!str_cmp(arg, "clan")
        || !str_cmp(arg, "ËÌÁÎ"))
        {
            SET_BIT(flags, WHO_F_CLAN);
            continue;
        }

        if ((i = cln_lookup(arg)) > 0)
        {
            name_add(ch, CLAN(i)->name, NULL, &clan_names);
            SET_BIT(flags, WHO_F_RCLAN);
            continue;
        }

        if ((i = rn_lookup(arg)) > 0 && RACE(i)->pcdata)
        {
            name_add(ch, RACE(i)->name, NULL, &race_names);
            SET_BIT(flags, WHO_F_RRACE);
            continue;
        }

        if (!IS_IMMORTAL(ch))
            continue;

        if ((i = cn_lookup(arg)) >= 0)
        {
            name_add(ch, CLASS(i)->name, NULL, &class_names);
            SET_BIT(flags, WHO_F_RCLASS);
            continue;
        }

        if (is_number(arg))
        {
            switch (++nNumber)
            {
                case 1:
                    iLevelLower = atoi(arg);
                    break;
                case 2:
                    iLevelUpper = atoi(arg);
                    break;
                default:
                    char_printf(ch, "%s: explicit argument (skipped)\n", arg);
                    break;
            }
            continue;
        }
    }

    /*
     * Now show matching chars.
     */
    output = buf_new(ch->lang);
    for (n = 0; n < 2; n++)
    {
        if (n == 1 && nMatch > 0)
        {
            if (IS_IMMORTAL(ch) && (wizlock || newlock || IS_SET(muddy_mode, MUDDY_TEST_MODE) || !IS_SET(muddy_mode, MUDDY_NEWBIES)))
                buf_add(output, "{D==========================   {W÷áöîáñ éîæïòíáãéñ !!!{D   ==========================={x\n");

            if (wizlock && IS_IMMORTAL(ch))
                buf_add(output, "   {M* {R÷îéíáîéå : {Yóôïéô òåöéí WIZLOCK !!!{x\n");

            if (newlock && IS_IMMORTAL(ch))
                buf_add(output, "   {M* {R÷îéíáîéå : {Yóôïéô òåöéí NEWLOCK !!!{x\n");

            if (IS_SET(muddy_mode, MUDDY_TEST_MODE) && IS_IMMORTAL(ch))
                 buf_add(output, "{M*            {R÷îéíáîéå : {Yõóôáîï÷ìåî ôåóôï÷ùê òåöéí !!!{x\n");

            if (!IS_SET(muddy_mode, MUDDY_NEWBIES) && IS_IMMORTAL(ch))
                 buf_add(output, "{M*            {R÷îéíáîéå : {YúÁÐÒÅÝÅÎÙ ÎÏ×ÙÅ ÉÇÒÏËÉ !!!{x\n");

            buf_add(output, "{D================================================================================{x\n");
        }

        if( n == 1)
        {
             if (IS_SET(muddy_mode, MUDDY_TEST_MODE) && !IS_IMMORTAL(ch))
             {
                 buf_add(output, "{D==========================   {W÷áöîáñ éîæïòíáãéñ !!!{D   ==========================={x\n");
                 buf_add(output, "{M*            {R÷îéíáîéå : {Yõóôáîï÷ìåî ôåóôï÷ùê òåöéí !!!{x\n");
                 buf_add(output, "{D================================================================================{x\n");
             }
        }

        for (d = descriptor_list; d; d = d->next)
        {
            CHAR_DATA *wch;

            clan_t *clan;
            race_t *race;
            class_t *class;

            if (d->connected != CON_PLAYING)
                continue;

            wch = d->original ? d->original : d->character;
            if (!wch || !can_see(ch, wch))
                continue;

            if ((n == 0 && !IS_IMMORTAL(wch))
            || (n == 1 && IS_IMMORTAL(wch)))
            {
                continue;
            }

            count++;
            if (!IS_IMMORTAL(ch)
            && ch != wch
            && !is_affected(ch, gsn_detection)
            && IS_SET(wch->form, FORM_VAMPIRE | FORM_MECH | FORM_DEMON))
                continue;


            if (wch->level < iLevelLower
            || wch->level > iLevelUpper
            || (IS_SET(flags, WHO_F_IMM) && wch->level < LEVEL_IMMORTAL && !(wch->pcdata->security > 0))
            || (IS_SET(flags, WHO_F_PK) && !in_PK(ch, wch))
            || (IS_SET(flags, WHO_F_CLAN) && !wch->clan))
            {
                continue;
            }

            if (IS_SET(flags, WHO_F_TATTOO))
            {
                if ((obj = get_eq_char(wch, WEAR_TATTOO)) == NULL
                || tattoo_vnum != obj->pIndexData->vnum)
                {
                    continue;
                }
            }

            if (IS_SET(flags, WHO_F_RCLAN | WHO_F_CLAN))
            {
                if (!wch->clan
                || (clan = clan_lookup(wch->clan)) == NULL
                || (IS_SET(clan->flags, CLAN_HIDDEN)
                && wch->clan != ch->clan
                && !IS_IMMORTAL(ch))
                || (!IS_SET(flags, WHO_F_CLAN)
                && !is_name(clan->name, clan_names)))
                {
                    continue;
                }
            }

            if (IS_SET(flags, WHO_F_RRACE))
            {
                if ((race = race_lookup(wch->race)) == NULL
                || !is_name(race->name, race_names))
                {
                    continue;
                }
            }

            if (IS_SET(flags, WHO_F_RCLASS))
            {
                if ((class = class_lookup(wch->class)) == NULL
                || !is_name(class->name, class_names))
                {
                    continue;
                }
            }

            nMatch++;
            do_who_raw(ch, wch, output);
        }
    }

    max_on = UMAX(count, max_on);
    if (flags == 0)
        buf_printf(output, "{x\n÷Ù ÎÁÈÏÄÉÔÅÓØ × ÍÉÒÅ Astrum Metaphora");
    buf_printf(output, "{x\n÷ÓÅÇÏ ÉÇÒÏËÏ×: %d. óÅÇÏÄÎÑ ÍÁËÓÉÍÕÍ ÉÇÒÁÌÏ: %d.\n", nMatch, max_on);
    page_to_char(buf_string(output), ch);
    buf_free(output);

    bail_out:
    free_string(clan_names);
    free_string(class_names);
    free_string(race_names);
}

DO_FUN(do_nowhois)
{
    char arg[MAX_INPUT_LENGTH];

    argument = one_argument(argument, arg, sizeof(arg));
    if (IS_NPC(ch))
    {
        return;
    }

    if (arg[0] == '\0') TOGGLE_BIT(ch->comm, COMM_NOWHOIS);
    if (!strcmp(arg, "on")) SET_BIT(ch->comm, COMM_NOWHOIS);
    if (!strcmp(arg, "off")) REMOVE_BIT(ch->comm, COMM_NOWHOIS);

    if (!IS_SET(ch->comm, COMM_NOWHOIS))
        act("ôÙ ÐÕÂÌÉËÕÅÛØ ÉÎÆÏÒÍÁÃÉÀ Ï ÓÅÂÅ × ÓÐÉÓËÁÈ ÖÉÔÅÌÅÊ ÍÉÒÁ.", ch, NULL, NULL, TO_CHAR);
    else
        act("ôÙ ÓÔÉÒÁÅÛØ ÉÎÆÏÒÍÁÃÉÀ Ï ÓÅÂÅ ÉÚ ÓÐÉÓËÏ× ÖÉÔÅÌÅÊ ÍÉÒÁ.", ch, NULL, NULL, TO_CHAR);
}

/* whois command */
DO_FUN(do_whois)
{
    char arg[MAX_INPUT_LENGTH];
    char buf[MAX_STRING_LENGTH];
    const char *heshe = "He(she)";
    const char *immdesc;
    BUFFER *output = NULL;
    clan_t *clan;
    religion_t *religion;
    CHAR_DATA *wch = NULL;
    bool loaded = FALSE;

    one_argument(argument, arg, sizeof(arg));
    if (arg[0] == '\0')
    {
        char_act("You must provide a name.", ch);
        return;
    }

    if (!strcmp("self", arg) || !str_cmp(arg, "ÓÅÂÑ") || !str_cmp(arg, "Ñ"))
        wch = ch;
    else
        wch = gq_findchar(arg);
    if (wch == NULL)
    {
        loaded = TRUE;
        wch = char_load_special(arg);
    }
    if (wch == NULL)
    {
        char_act("îÉËÏÇÏ ÎÅÔ Ó ÔÁËÉÍ ÉÍÅÎÅÍ.", ch);
        return;
    }

    if (IS_SET(wch->comm, COMM_NOWHOIS) && ch != wch && !IS_IMMORTAL(ch))
    {
        char_act("ï ÔÁËÏÍ ÓÕÝÅÓÔ×Å ÎÉÞÅÇÏ ÎÅ ÉÚ×ÅÓÔÎÏ.", ch);
        if (loaded)
            char_nuke(wch);
        return;
    }

    if (output == NULL)
        output = buf_new(ch->lang);

    immdesc = mlstr_cval (wch->immdesc, ch);

    if (IS_IMMORTAL(ch) && !IS_NULLSTR(immdesc))
    {
        buf_printf(output, "{x--------------- ïðéóáîéå ïô âïçï÷ -----------------\n\r");
        buf_printf(output, "%s{x", immdesc);
    }

    buf_printf(output, "{x---------------------------------------------------\n");

    if (IS_IMMORTAL(wch) && wch->imm_name)
    {
        buf_printf(output, "%s{x%s{x aka %s {x(%s{x), the %s %s.\n",
               wch->pcdata->pretitle, wch->imm_name, wch->name, wch->pcdata->title,
               flag_string(sex_table, wch->sex),
               race_name(ORG_RACE(wch)));
    } else
    {
        buf_printf(output, "%s{x%s (%s{x), the %s %s.\n",
               wch->pcdata->pretitle, wch->name, wch->pcdata->title,
               flag_string(sex_table, wch->sex),
               race_name(ORG_RACE(wch)));
    }
    snprintf(buf, sizeof(buf), "%s-%s",
             flag_string(ethos_table, wch->ethos),
             IS_GOOD(wch)    ? "good" :
             IS_NEUTRAL(wch) ? "neutral" :
             IS_EVIL(wch)    ? "evil" :
             "unknown");

    buf_printf(output,
               "Lvl: %d+(%d) Class: %s  Align: %s.\n",
               wch->level,
               wch->aff_level,
               class_name(wch),buf);

    clan = clan_lookup(wch->clan);
    if (wch->clan && clan && !IS_IMMORTAL(wch))
    {
        if (wch->pcdata->clan_status != -1)
        {
            switch (wch->pcdata->clan_status)
            {
                case CLAN_COMMONER: buf_add(output, "Commoner"); break;
                case CLAN_SECOND: buf_add(output, "Secondary Leader"); break;
                case CLAN_LEADER: buf_add(output, "Clan Leader"); break;
                case CLAN_NEWBIE: buf_add(output, "Newbie"); break;
                case CLAN_VETERAN: buf_add(output, "Veteran"); break;
                case CLAN_ELITE: buf_add(output, "Elite"); break;
                default: buf_add(output, "Commoner");
            }
        }
        buf_printf(output, "{x of clan %s, {x", clan->name);
    }
    buf_printf(output, "%s %d years old.\n", heshe, get_age(wch));

/* îÁ×ÅÒÎÏ ÌÉÛÎÅÅ... (c) GrayMage // ÷ÏÔ ÔÁË -- ÄÅÌÁÅÛØ ÅÍÕ, ÄÅÌÁÅÛØ, Á
                                  // ÏÎ: ÌÉÛÎÅÅ...
        buf_printf(output, "Kills %d %s and %d %s.\n",
                    wch->pcdata->has_killed,
                    IS_GOOD(ch) ? GETMSG("non-goods", ch->lang) :
                    IS_EVIL(ch) ? GETMSG("non-evils", ch->lang) :
                                  GETMSG("non-neutrals", ch->lang),
                    wch->pcdata->anti_killed,
                    IS_GOOD(ch) ? GETMSG("goods", ch->lang) :
                    IS_EVIL(ch) ? GETMSG("evils", ch->lang) :
                                  GETMSG("neutrals", ch->lang));
*/
    if (!IS_IMMORTAL(wch))
    {
        buf_printf(output, "Joined to %d and completed %d global quests.\n", wch->pcdata->StatAllGlobalQuests, wch->pcdata->StatWinGlobalQuests);
        buf_printf(output, "Requested %d and completed %d quests.\n", wch->pcdata->questnumber, wch->pcdata->questcomplete);
        buf_printf(output, "Earned %d bonus points and %d quest points.\n", wch->pcdata->bp_earned, wch->pcdata->qp_earned);
    }

    religion = religion_lookup(wch->religion);
    if (wch->religion && religion && !IS_IMMORTAL(wch)
    && !IS_SET(religion->flags, RELIGION_HIDDEN))
        buf_printf(output,"Believes the religion of %s.\n", religion->name);

    if (IS_MARRYED(wch))
        buf_printf(output,"%s is married with %s.\n", wch->name, wch->pcdata->marryed);

//        do_who_raw(ch, wch, output);

    buf_add(output, "{x");
    page_to_char(buf_string(output), ch);
    buf_free(output);
    if (loaded)
        char_nuke(wch);
}

DO_FUN(do_count)
{
    int count;
    DESCRIPTOR_DATA *d;

    count = 0;

    for (d = descriptor_list; d != NULL; d = d->next)
        if (d->connected == CON_PLAYING && can_see(ch, d->character))
            count++;

    max_on = UMAX(count,max_on);

    act_puts("÷ÓÅÇÏ ÂÙÌÏ $j $qj{ÉÇÒÏËÏ×}, ", ch, (const void *) count, NULL, TO_CHAR | ACT_NOLF, POS_DEAD);
    if (max_on == count)
        act_puts("ÍÁËÓÉÍÕÍ ÓÅÇÏÄÎÑ", ch, NULL, NULL, TO_CHAR | ACT_NOUCASE, POS_DEAD);
    else
        act_puts("ÍÁËÓÉÍÕÍ ÎÁ ÓÅÇÏÄÎÑ ÂÙÌÏ $j.", ch, (const void *) max_on, NULL, TO_CHAR | ACT_NOUCASE, POS_DEAD);
}

DO_FUN(do_inventory)
{
    char_act("You are carrying : ", ch);
    show_list_to_char(ch->carrying, ch, TRUE, TRUE);
}

DO_FUN(do_equipment)
{
    char arg[MAX_INPUT_LENGTH];
    OBJ_DATA *obj;
    int i;
    bool found;
    bool show_all = FALSE;

    one_argument(argument, arg, sizeof(arg));
    if (arg[0] != '\0'  && (!str_prefix(arg, "all")  || !str_prefix(arg, "ÐÏÌÎÁÑ") || !str_cmp(argument, "×ÓÅ")))
        show_all = TRUE;

    act("You are using : ", ch, NULL, NULL, TO_CHAR);
    found = FALSE;
    for (i = 0; show_order[i] >= 0; i++)
    {
        if ((obj = get_eq_char(ch, show_order[i])) != NULL)
        {
            show_obj_to_char(ch, obj, show_order[i]);
            found = TRUE;
        } else if (class_can_wear(ch, show_order[i])  && race_can_wear(ch, show_order[i])  && show_all)
        {
            if ((show_order[i] == WEAR_HOLD  || show_order[i] == WEAR_SHIELD)  && get_eq_char(ch, WEAR_SECOND_WIELD) != NULL)
            {
                continue;
            }

            if (show_order[i] == WEAR_SECOND_WIELD  && (get_eq_char(ch, WEAR_SHIELD) != NULL  || get_eq_char(ch, WEAR_HOLD) != NULL))
            {
                continue;
            }

            if ((show_order[i] == WEAR_TATTOO  && ch->religion == 0)   || (show_order[i] == WEAR_CLANMARK    && ch->clan == 0))
            {
                continue;
            }

            act(wear_loc_names[show_order[i]], ch, "{G<{z{rnothing{z{G>{z", NULL, TO_CHAR);
            found = TRUE;
        }

    }

    for (obj = ch->carrying; obj != NULL; obj = obj->next_content)
    {
        if (obj->wear_loc != WEAR_STUCK_IN)
            continue;

        show_obj_to_char(ch, obj, WEAR_STUCK_IN);
        found = TRUE;
    }

    if (!found)
        act("Nothing.", ch, NULL, NULL, TO_CHAR);
}

DO_FUN(do_compare)
{
    char arg1[MAX_INPUT_LENGTH];
    char arg2[MAX_INPUT_LENGTH];
    OBJ_DATA *obj1;
    OBJ_DATA *obj2;
    int value1;
    int value2;
    char *cmsg;

    argument = one_argument(argument, arg1, sizeof(arg1));
    argument = one_argument(argument, arg2, sizeof(arg2));
    if (arg1[0] == '\0')
    {
        act("Compare what to what?", ch, NULL, NULL, TO_CHAR);
        return;
    }

    if ((obj1 = get_obj_carry(ch, arg1)) == NULL)
    {
        act("You do not have that item.", ch, NULL, NULL, TO_CHAR);
        return;
    }

    if (arg2[0] == '\0')
    {
        for (obj2 = ch->carrying; obj2 != NULL; obj2 = obj2->next_content)
            if (obj2->wear_loc != WEAR_NONE
            && can_see_obj(ch,obj2)
            && obj1->pIndexData->item_type == obj2->pIndexData->item_type
            && (obj1->wear_flags & obj2->wear_flags & ~ITEM_TAKE))
                break;

        if (obj2 == NULL)
        {
            act("You aren't wearing anything comparable.", ch, NULL, NULL, TO_CHAR);
            return;
        }
    } else if ((obj2 = get_obj_carry(ch,arg2)) == NULL)
    {
        act("You do not have that item.", ch, NULL, NULL, TO_CHAR);
        return;
    }

    cmsg            = NULL;
    value1  = 0;
    value2  = 0;

    if (obj1 == obj2)
        cmsg = "You compare $p to $p.  It looks about the same.";
    else if (obj1->pIndexData->item_type != obj2->pIndexData->item_type)
        cmsg = "You can't compare $p and $P.";
    else
    {
        switch (obj1->pIndexData->item_type)
        {
            default:
                cmsg = "You can't compare $p and $P.";
                break;

            case ITEM_ARMOR:
                value1 = obj1->value[0]+obj1->value[1]+obj1->value[2];
                value2 = obj2->value[0]+obj2->value[1]+obj2->value[2];
                break;

            case ITEM_WEAPON:
                value1 = (1 + obj1->value[2]) * obj1->value[1];
                value2 = (1 + obj2->value[2]) * obj2->value[1];
                break;
        }
    }

    if (cmsg == NULL)
    {
        if (value1 == value2)
            cmsg = "$p and $P look about the same.";
        else if (value1  > value2)
            cmsg = "$p looks better than $P.";
        else
            cmsg = "$p looks worse than $P.";
    }

    act(cmsg, ch, obj1, obj2, TO_CHAR);
}

DO_FUN(do_credits)
{
    do_help(ch, "muddy");
}

DO_FUN(do_where)
{
    char arg[MAX_INPUT_LENGTH];
    AREA_DATA *pArea;
    CHAR_DATA *victim;
    DESCRIPTOR_DATA *d;
    bool found;
    bool fPKonly = FALSE;
    BUFFER *output;
    int sn, mana = 0;
    int chance = 0;
    int index;
    AREA_DATA *pArea2;

    if (!ch->in_room || !ch->in_room->area)
    {
        log_printf("BUG [do_where]! Char %s not in area.", ch->name);
        return;
    }

    one_argument(argument, arg, sizeof(arg));

    if (!check_blind(ch))
        return;

    if (room_is_dark(ch))
    {
        char_act("It's too dark to see.", ch);
        return;
    }

    if (IS_SET(ch->in_room->room_flags, ROOM_NOWHERE)
    && !IS_IMMORTAL(ch))
    {
        char_act("You can not understand, where you are.", ch);
        return;
    }

    sn = sn_lookup("lore");
    pArea2 = NULL;
    index = number_range(2, area_last->vnum);

    chance = get_skill(ch, sn);

    mana = SKILL(sn_lookup("lore"))->min_mana;
    if (ch->mana < mana)
        chance /= 2;
    else
        ch->mana -= mana;

    if (chance < 1)
        chance = 50;

    if (number_percent() < chance)
    {
        pArea2 = ch->in_room->area;
        check_improve(ch, sn, TRUE, 15);
    } 
    else
    {
        pArea2 = area_lookup(index);
    }

    if (!str_cmp(arg,"pk")
        || !str_cmp(arg, "ÐË"))
    {
        fPKonly = TRUE;
    }
    WAIT_STATE(ch, 1);

    if (arg[0] == '\0' || fPKonly)
    {
        pArea = ch->in_room->area;
        output = buf_new(ch->lang);

        if (IS_IMMORTAL(ch))
            buf_printf(output,"RVnum : [%d-%d] AVnum : %d (%d) in %s.\n",
                       pArea->min_vnum, pArea->max_vnum,
                       pArea->vnum, pArea->security,
                       pArea->file_name);

        if (ch->sector_level > 0)
            buf_add(output, "You feel yourself comfortably here.\n");
        else if (ch->sector_level < 0)
            buf_add(output, "You feel yourself uncomfortably here.\n");

        if (pArea->clan_owner)
            buf_printf(output, "This area belongs to %s clan.\n", pArea->clan_owner->name);

        if ( IS_SET(ch->in_room->room_flags, ROOM_FRESHWATER_FISH) )
        {
            if(number_percent() < get_skill(ch, gsn_lore_fishing))
            {
                buf_printf(output,"úÄÅÓØ ÍÏÖÎÏ ÐÏÒÙÂÁÞÉÔØ × ÐÒÅÓÎÏÊ ×ÏÄÅ.\n");
                check_improve(ch, gsn_lore_fishing, TRUE, 1);
            }
            else
                check_improve(ch, gsn_lore_fishing, FALSE, 1);
        }
        if ( IS_SET(ch->in_room->room_flags, ROOM_SALTWATER_FISH) )
        {
            if(number_percent() < get_skill(ch, gsn_lore_fishing))
            {
                buf_printf(output,"úÄÅÓØ ÍÏÖÎÏ ÐÏÒÙÂÁÞÉÔØ × ÓÏÌÅÎÏÊ ×ÏÄÅ.\n");
                check_improve(ch, gsn_lore_fishing, TRUE, 1);
            }
            else
                check_improve(ch, gsn_lore_fishing, FALSE, 1);
        }

        if (IS_SET (ch->in_room->area->flags, AREA_UNDER_CONSTRUCTION))
        {
            buf_printf(output,"úÏÎÁ ÎÁÈÏÄÉÔÓÑ × ÒÅÖÉÍÅ ÔÅÓÔÉÒÏ×ÁÎÉÑ.\n");
        }

        page_to_char(buf_string(output), ch);
        buf_free(output);
        act("Players in your area ({G$t{x):",
            ch, pArea2->name, NULL, TO_CHAR);

        found = FALSE;
        for (d = descriptor_list; d; d = d->next)
        {
            if (d->connected == CON_PLAYING
            && (victim = d->character) != NULL
            && !IS_NPC(victim)
            && (!fPKonly || in_PK(ch, victim))
            && victim->in_room != NULL
            && victim->in_room->area == ch->in_room->area
            && !is_affected(victim, gsn_stealth))
            {
                CHAR_DATA *doppel;
                found = TRUE;

                if (is_affected(victim, gsn_doppelganger)
                && (IS_NPC(ch)
                || !IS_SET(ch->plr_flags, PLR_HOLYLIGHT)))
                    doppel = victim->doppel;
                else
                    doppel = victim;

                if (can_see(ch, victim))
                //act_puts3("$FL28{$t $N} $R", ch,
                act_puts3("$FL28{$t $T} $R", ch,
                          (in_PK(ch, doppel)
                           && !IS_IMMORTAL(ch)
                           && !IS_IMMORTAL(doppel)) ? "{r[{RPK{r]{x" : "    ",
                          //victim,
                          (IS_SET(ch->comm2, COMM2_RUSNAMES) && victim->pcdata && victim->pcdata->rusnames[0]) ? victim->pcdata->rusnames[0] : victim->name,
                          victim->in_room,
                          TO_CHAR | ACT_TRANS, POS_RESTING);
                else
                {
                    // char can't see victim, but the spy can help
                    clan_t * clan = clan_lookup (ch->clan);

                    if (clan && altar_works (ch, OUTPOST_POS) && IS_SET (clan->conq_flags, CLAN_WITH_SPY))
                        act_puts3("$FL28{$t $T} $R", ch,
                                  (in_PK(ch, doppel)
                                   && !IS_IMMORTAL(ch)
                                   && !IS_IMMORTAL(doppel)) ? "{r[{RPK{r]{x" : "    ",
                                  "someone",
                                  victim->in_room,
                                  TO_CHAR | ACT_TRANS, POS_RESTING);

                }
            }
        }
        if (!found)
            act("îÉËÏÇÏ.", ch, NULL, NULL, TO_CHAR);
    } 
    else
    {
        int number = number_argument(argument, arg, sizeof(arg));
        int count = 0;

        found = FALSE;
        for (victim = char_list; victim != NULL; victim = victim->next)
        {
            if (victim->in_room != NULL
                && victim->in_room->area == ch->in_room->area
                && can_see(ch, victim)
                //&& is_name(arg, victim->name)
                && is_name_rus(victim, arg)
                && !is_affected(victim, gsn_stealth))
            {
                if (++count == number)
                {
                    found = TRUE;
                    act("$FL28{$N} $r", ch, victim->in_room, victim, TO_CHAR);
                    break;
                }
            }
        }
        if (!found)
            act("You don't find $T.", ch, NULL, arg, TO_CHAR);
    }
}

DO_FUN(do_consider)
{
    char arg[MAX_INPUT_LENGTH];
    CHAR_DATA *victim;
    char *cmsg;
    char *align;
    int diff;

    one_argument(argument, arg, sizeof(arg));

    if (arg[0] == '\0')
    {
        act("Consider killing whom?", ch, NULL, NULL, TO_CHAR);
        return;
    }

    if ((victim = get_char_room(ch, arg)) == NULL)
    {
        act("They aren't here.", ch, NULL, NULL, TO_CHAR);
        return;
    }

    if (victim == ch)
    {
        act("Suicide is against your way.", ch, NULL, NULL, TO_CHAR);
        return;
    }

    if (!in_PK(ch, victim))
    {
        act("Don't even think about it.", ch, NULL, NULL, TO_CHAR);
        return;
    }

    if (!IS_NPC(victim) && IS_SET(victim->comm, PLR_PEACE))
    {
        act("Uh-you! Peace mudder!", ch, NULL, NULL, TO_CHAR);
        return;
    }

    diff = victim->level - ch->level;

    if (diff <= -10)        cmsg = "You can kill $N naked and weaponless.";
    else if (diff <=  -5)   cmsg = "$N is no match for you.";
    else if (diff <=  -2)   cmsg = "$N looks like an easy kill.";
    else if (diff <=   2)   cmsg = "The perfect match!";
    else if (diff <=   7)   cmsg = "$N says '{GDo you feel lucky, punk?{x'.";
    else if (diff <=   12)  cmsg = "$N laughs at you mercilessly.";
    else                    cmsg = "Death will thank you for your gift.";

    if (IS_EVIL(ch) && IS_EVIL(victim))
        align = "$N ÚÌÏÂÎÏ ÓËÁÌÉÔÓÑ × Ô×ÏÀ ÓÔÏÒÏÎÕ.";
    else if (IS_GOOD(victim) && IS_GOOD(ch))
        align = "$N ÔÅÐÌÏ ÐÒÉ×ÅÔÓÔ×ÕÅÔ ÔÅÂÑ.";
    else if (IS_GOOD(victim) && IS_EVIL(ch))
        align = "$N ÕÌÙÂÁÅÔÓÑ ÔÅÂÅ, ÎÁÄÅÑÓØ ÞÔÏ ÔÙ Ó×ÅÒÎÅÛØ Ó ÐÕÔÉ ÚÌÁ.";
    else if (IS_EVIL(victim) && IS_GOOD(ch))
        align = "$N ÚÌÏÂÎÏ ÓËÁÌÉÔÓÑ × Ô×ÏÀ ÓÔÏÒÏÎÕ.";
    else if (IS_NEUTRAL(ch) && IS_EVIL(victim))
        align = "$N ÚÌÏÂÎÏ ÓËÁÌÉÔÓÑ.";
    else if (IS_NEUTRAL(ch) && IS_GOOD(victim))
        align = "$N ÓÞÁÓÔÌÉ×Ï ÕÌÙÂÁÅÔÓÑ.";
    else if (IS_NEUTRAL(ch) && IS_NEUTRAL(victim))
        align = "$N ÐÏÈÏÖÅ ÎÅ ÚÁÉÎÔÅÒÅÓÏ×ÁÎ × ÔÅÂÅ.";
    else
        align = "$N ×ÙÇÌÑÄÉÔ ÁÂÓÏÌÀÔÎÏ ÎÅÚÁÉÎÔÅÒÅÓÏ×ÁÎÎÙÍ.";

    act(cmsg, ch, NULL, victim, TO_CHAR);
    act(align, ch, NULL, victim, TO_CHAR);
}

void set_title(CHAR_DATA *ch, const char *title)
{
    char buf[MAX_TITLE_LENGTH];
    static char nospace[] = "-.,!?':";

    buf[0] = '\0';

    if (title)
    {
        if (strchr(nospace, *cstrfirst(title)) == NULL)
        {
            buf[0] = ' ';
            buf[1] = '\0';
        }

        strnzcat(buf, sizeof(buf), title);
    }

    free_string(ch->pcdata->title);
    ch->pcdata->title = str_dup(buf);
}

void set_pretitle(CHAR_DATA *ch, const char *pretitle)
{
    char buf[MAX_TITLE_LENGTH] ;
    static char nospace[] = "-.,!?':" ;

    strnzcpy (buf, sizeof(buf), pretitle) ;

    if (pretitle && pretitle [strlen (pretitle) - 1] != ' ' &&
        strchr (nospace, pretitle [strlen (pretitle) - 1]) == 0 &&
        strlen (buf) < MAX_TITLE_LENGTH - 1)
    {
        buf[strlen (buf)]   = ' '  ;
        buf[strlen (buf)+1] = '\0' ;
    }

    free_string (ch->pcdata->pretitle) ;
    ch->pcdata->pretitle = str_dup (buf) ;
}

DO_FUN(do_title)
{
    if (IS_NPC(ch))
        return;

    if (IS_AFFECTED(ch, AFF_CHARM))
        return;

    if (IS_SET(ch->plr_flags, PLR_NOTITLE))
    {
        act("You can't change your title.", ch, NULL, NULL, TO_CHAR);
        return;
    }

    if (argument[0] == '\0')
    {
        act("Change your title to what?", ch, NULL, NULL, TO_CHAR);
        return;
    }

    if (strstr(argument, "{/"))
    {
        char_act("Illegal characters in title.", ch);
        return;
    }

    if ((ch->pcdata->questpoints < 50)
    && !IS_IMMORTAL(ch))
    {
        act("õ ÔÅÂÑ ÎÅÄÏÓÔÁÔÏÞÎÏ Ë×ÅÓÔÏ×ÙÈ ÏÞËÏ× ÄÌÑ ÓÍÅÎÙ ÔÉÔÕÌÁ.",
            ch, NULL, NULL, TO_CHAR);
        return;
    }

    if (!IS_IMMORTAL(ch))
        ch->pcdata->questpoints -= 50;

    set_title(ch, argument);
    char_printf(ch, "Now you : %s %s.\n", ch->name, ch->pcdata->title);

    if (IS_SET(ch->plr_flags, PLR_AUTOTITLE))
        act("\n÷ÎÉÍÁÎÉÅ! õ ×ÁÓ ÓÔÏÉÔ ÒÅÖÉÍ AUTOTITLE!", ch, NULL, NULL, TO_CHAR);
}

DO_FUN(do_description)
{
    char arg[MAX_STRING_LENGTH];

    if (IS_NPC(ch))
    {
        act("Huh?", ch, NULL, NULL, TO_CHAR);
        return;
    }

    one_argument(argument, arg, sizeof(arg));

    if (!str_cmp(arg, "edit")
    || !str_cmp(arg, "ÒÅÄÁËÔÉÒÏ×ÁÔØ"))
    {
        string_append(ch, mlstr_convert(&ch->description, -1));
        return;
    }

    char_printf(ch, "Your description is : \n"
                "%s\n"
                "Use 'desc edit' to edit your description.\n",
                mlstr_mval(ch->description));
}

DO_FUN(do_report)
{
    CHAR_DATA * pet;
    BUFFER    * output = NULL;
    char        arg [MAX_STRING_LENGTH];
    MOB_EXTRA * ability;


    // report pet - output info about pet with receive_level act flag
    // syntax: report pet <pet_name>
    argument = one_argument(argument, arg, sizeof(arg));

    if (!str_cmp (arg, "pet"))
    {
        // checks, checks, checks
        if (argument[0] == '\0')
        {
            char_act ("Syntax: {creport pet <pet_name>{x", ch);
            return;
        }
        pet = get_char_room (ch, argument);
        if (pet == NULL)
        {
            char_printf (ch, "You can't find %s in this room.\n", argument);
            return;
        }
        if (!IS_NPC (pet))
        {
            act("$N is not a mobile. Just ask $gN{him}.", ch, NULL, pet, TO_CHAR);
            return;
        }
        if ((!IS_AFFECTED(pet, AFF_CHARM) || (pet->master != ch)) && !IS_IMMORTAL(ch))
        {
            act("$N is not your pet.", ch, NULL, pet, TO_CHAR);
            return;
        }
        if (!IS_SET(pet->pIndexData->act, ACT_RECEIVE_LEVEL))
        {
            act("It's simple mobile. You can't retrieve any special information about it.", ch, NULL, pet, TO_CHAR);
            return;
        }

        // Yes! It's right mobile!
        output = buf_new(ch->lang);
        buf_add(output,    "\n    {G/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\\{x\n");
        buf_printf(output, "{x    {G|             {CDetailed info for {W%-20s          {G|{x\n", fix_short(mlstr_cval(pet->short_descr, ch)));
        buf_add(output,    "{x    {G|-----------------------------------------------------------|{x\n");

        buf_printf(output, "{x    {G|    {WCurrent rank: {c%2d{x,  {WExperience to next rank:{c%5d{x       {G|{x\n",
            pet->mob_rank, pet->mob_tnl);
        buf_add(output,    "{x    {G|                                                           |{x\n");

        buf_add(output,    "{x    {G|    {WVital statistics:                                      {G|{x\n");
        buf_printf(output, "{x    {G|        {WHit points {C: {y%5d{x/{y%5d{x   {WMana    {C: {y%5d{x/{y%5d{x   {G|{x\n",
            pet->hit, pet->max_hit,pet->mana, pet->max_mana );
        buf_printf(output, "{x    {G|        {WHitroll    {C:{R%4d{x           {WDamroll {C:{R%4d           {G|{x\n",
            pet->hitroll, pet->damroll );

        if (pet->extra_attacks || pet->abilities)
        {
            buf_add(output,"{x    {G|-----------------------------------------------------------|{x\n");
            buf_add(output,"{x    {G|    {WExtra abilities:                                       {G|{x\n");
            if (pet->extra_attacks)
                buf_printf(output, "{x    {G|        {WExtra attacks        {C:{R%2d{x                           {G|{x\n",
                    pet->extra_attacks);
            for (ability = created_golem_extra; ability->name != NULL; ++ability)
                if (IS_SET(pet->abilities, ability->flag))
                    buf_printf(output, "{x    {G|        {W%-40s           {G|{x\n", GETMSG (ability->name, ch->lang));
        }

        buf_add(output,    "{x    {G|___________________________________________________________|{x\n");
        buf_add(output, "{x");

        page_to_char(buf_string(output), ch);
        buf_free(output);
        return;
    }

    doprintf(do_say, ch, "I have %d/%d hp %d/%d mana %d/%d mv.",
        ch->hit, ch->max_hit,
        ch->mana, ch->max_mana,
        ch->move, ch->max_move);
}

/*
 * 'Wimpy' originally by Dionysos.
 */
DO_FUN(do_wimpy)
{
    char arg[MAX_INPUT_LENGTH];
    int wimpy;

    if (IS_SAMURAI(ch))
    {
        char_printf(ch, "You don't deal with wimpies, or such feary things.\n");
        if (ch->wimpy != 0)
            ch->wimpy = 0;
        return;
    }

    one_argument(argument, arg, sizeof(arg));

    if (arg[0] == '\0')
        wimpy = ch->max_hit / 5;
    else
        wimpy = atoi(arg);

    if (wimpy < 0)
    {
        act("Your courage exceeds your wisdom.", ch, NULL, NULL, TO_CHAR);
        return;
    }

    if (wimpy > ch->max_hit / 2)
    {
        act("Such cowardice ill becomes you.", ch, NULL, NULL, TO_CHAR);
        return;
    }

    ch->wimpy       = wimpy;

    char_printf(ch, "Wimpy set to %d hit points.\n", wimpy);
    return;
}

DO_FUN(do_password)
{
    char arg1[MAX_INPUT_LENGTH];
    char arg2[MAX_INPUT_LENGTH];
    const char *pwdold;
    const char *pwdnew;

    if (IS_NPC(ch))
        return;

    argument = first_arg(argument, arg1, sizeof(arg1), FALSE);
    argument = first_arg(argument, arg2, sizeof(arg2), FALSE);

    pwdold = ch->pcdata->pwd;

    if (arg1[0] == '\0' || arg2[0] == '\0')
    {
        act("óÉÎÔÁËÓÉÓ: password <ÓÔÁÒÙÊ ÐÁÒÏÌØ> <ÎÏ×ÙÊ ÐÁÒÏÌØ>.", ch, NULL, NULL, TO_CHAR);
        return;
    }

    if (strcmp(str_crypt(arg1), pwdold))
    {
        WAIT_STATE(ch, 40);
        act("îÅÐÒÁ×ÉÌØÎÙÊ ÐÁÒÏÌØ.  öÄÕ 10 ÓÅËÕÎÄ...", ch, NULL, NULL, TO_CHAR);
        return;
    }

    if (strlen(arg2) < 5)
    {
        char_act("îÏ×ÙÊ ÐÁÒÏÌØ ÄÏÌÖÅÎ ÓÏÓÔÏÑÔØ ÍÉÎÉÍÕÍ ÉÚ ÐÑÔÉ ÓÉÍ×ÏÌÏ×.", ch);
        return;
    }

    /*
     * No tilde allowed because of player file format.
     */
    pwdnew = arg2;
    if (strchr(pwdnew, '~') != NULL)
    {
        char_act("îÏ×ÙÊ ÐÁÒÏÌØ ÎÅÄÏÐÕÓÔÉÍ, ÐÏÐÒÏÂÕÊ ÓÎÏ×Á.", ch);
        return;
    }
    pwdnew = str_crypt(arg2);
    free_string(ch->pcdata->pwd);
    ch->pcdata->pwd = str_dup(pwdnew);
    act("ô×ÏÊ ÐÁÒÏÌØ ÉÚÍÅÎÅÎ.", ch, NULL, NULL, TO_CHAR);
    save_char_obj(ch, FALSE, FALSE);
    return;
}

void scan_list(ROOM_INDEX_DATA *scan_room, CHAR_DATA *ch, int depth, int door)
{
    CHAR_DATA *rch;

    if (scan_room == NULL)
        return;

    for (rch = scan_room->people; rch != NULL; rch = rch->next_in_room)
    {
        if (rch == ch || !can_see(ch, rch))
            continue;
        act("-       $N.", ch, NULL, rch, TO_CHAR);
    }
}

DO_FUN(do_scan2)
{
    extern char *const dir_name[];
    EXIT_DATA *pExit;
    int door;

    if (IS_NPC(ch) || ch->level < LEVEL_IMMORTAL)
        act("$n looks all around.", ch, NULL, NULL, TO_ROOM);
    if (!check_blind(ch))
        return;

    act("Looking around you see : ", ch, NULL, NULL, TO_CHAR);

    act("{Chere{x : ", ch, NULL, NULL, TO_CHAR);
    scan_list(ch->in_room, ch, 0, -1);
    for (door = 0; door < 6; door++)
    {
        if ((pExit = ch->in_room->exit[door]) == NULL
            || !pExit->to_room.r
            || !can_see_room(ch,pExit->to_room.r))
            continue;
        if (IS_SET(pExit->exit_info, EX_INVIS)
            && pExit->to_room.r->people == NULL)
            continue;
        cha

Showing the first 100 KB of 196.5 KB. Download the archive for the full file.

Site Stats

Snippets: 1791
Codebases: 571